CloudFiles API
Attachments
List Attachments
1 min
code examples curl location request get 'https //api cloudfiles io/v1/attachments?objectid=string\&objecttype=string' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'authorization bearer api key' \\ \ 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"); myheaders append("authorization", "bearer api key"); 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?objectid=string\&objecttype=string", 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?objectid=string\&objecttype=string") 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\["authorization"] = "bearer api key" 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?objectid=string\&objecttype=string" 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', 'authorization' 'bearer api key' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses