CloudFiles API
Attachments
List Attachments
1min
code examples curl location request get 'https //api cloudfiles io/v1/attachments' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '"{\n \\"resource\\" \\"{{resource id}}\\",\n \\"resourcetype\\" \\"folder\\",\n \\"source\\" \\"hubspot\\",\n \\"objecttype\\" \\"contact\\",\n \\"objectid\\" \\"51\\"\n}"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify("{\n \\"resource\\" \\"{{resource id}}\\",\n \\"resourcetype\\" \\"folder\\",\n \\"source\\" \\"hubspot\\",\n \\"objecttype\\" \\"contact\\",\n \\"objectid\\" \\"51\\"\n}"); var requestoptions = { method 'get', headers myheaders, body raw, redirect 'follow' }; fetch("https //api cloudfiles io/v1/attachments", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api cloudfiles io/v1/attachments") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump("{\n \\"resource\\" \\"{{resource id}}\\",\n \\"resourcetype\\" \\"folder\\",\n \\"source\\" \\"hubspot\\",\n \\"objecttype\\" \\"contact\\",\n \\"objectid\\" \\"51\\"\n}") response = https request(request) puts response read body import requests import json url = "https //api cloudfiles io/v1/attachments" payload = json dumps("{\n \\"resource\\" \\"{{resource id}}\\",\n \\"resourcetype\\" \\"folder\\",\n \\"source\\" \\"hubspot\\",\n \\"objecttype\\" \\"contact\\",\n \\"objectid\\" \\"51\\"\n}") headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses \[ { "resourceid" "6544e539be82e258235e3965", "library" "cloudfiles", "id" "6544e949be82e258235e3ce9", "resourcetype" "dataroom", "name" "test ", "createdat" "2023 11 03t12 36 25 796z", "createdby" "sharmishtha dash", "createdbyemail" "sharmishtha\@cloudfiles io", "linkid" "6544e951fe4ec145b1fd8296" }, { "resourceid" "605c543b1ea4f832f928acd3", "driveid" "workspace", "library" "cloudfiles", "id" "6544e9fffe4ec145b1fd8368", "resourcetype" "file", "name" "cloudfiles vs hubspot documents", "createdat" "2023 11 03t12 39 27 693z", "createdby" "sharmishtha dash", "createdbyemail" "sharmishtha\@cloudfiles io", "linkid" "6544ee145255981a9e6a2b72" }, { "resourceid" "65519d0d30f4f4fd3812584b", "library" "cloudfiles", "id" "65519e66513f1e76cb74f8a9", "resourcetype" "dataroom", "name" "lyka template dataroom", "createdat" "2023 11 13t03 56 22 923z", "createdby" "system user", "createdbyemail" "system 604723a2cc243148023ba27e\@cloudfiles io", "linkid" "65519e69513f1e76cb74f8bf" } ]