Delete Attachments
1 min
code examples curl request post \\ \ url 'https //api cloudfiles io/v1/attachments/findanddelete/batch?library=sharepoint\&library=sharepoint' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'authorization bearer api key' \\ \ data '"\[\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"folder\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n },\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"file\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n }\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 {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"folder\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n },\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"file\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n }\n]"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api cloudfiles io/v1/attachments/findanddelete/batch?library=sharepoint\&library=sharepoint", 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/findanddelete/batch?library=sharepoint\&library=sharepoint") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["authorization"] = "bearer api key" request body = json dump("\[\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"folder\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n },\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"file\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n }\n]") response = https request(request) puts response read body import requests import json url = "https //api cloudfiles io/v1/attachments/findanddelete/batch?library=sharepoint\&library=sharepoint" payload = json dumps("\[\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"folder\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n },\n {\n \\"resourceid\\" \\"01kehakuv2anom2hikmzdjmvaeyg3m7f27\\",\n \\"resourcetype\\" \\"file\\",\n \\"objectid\\" \\"001dl00000zngx5qal\\",\n \\"objecttype\\" \\"account\\"\n }\n]") headers = { 'accept' 'application/json', 'content type' 'application/json', 'authorization' 'bearer api key' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses