CloudFiles API
Files
Commit CloudFiles file
1min
code examples curl location 'https //api cloudfiles io/v1/files?library=cloudfiles\&library=cloudfiles' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '"{\n \\"name\\" \\"test pdf\\",\n \\"folderid\\" \\"{{parent folder id}}\\",\n \\"externalid\\" \\"{{external id from get upload session}}\\",\n \\"size\\" 12345\n}"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify("{\n \\"name\\" \\"test pdf\\",\n \\"folderid\\" \\"{{parent folder id}}\\",\n \\"externalid\\" \\"{{external id from get upload session}}\\",\n \\"size\\" 12345\n}"); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api cloudfiles io/v1/files?library=cloudfiles\&library=cloudfiles", 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/files?library=cloudfiles\&library=cloudfiles") 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 body = json dump("{\n \\"name\\" \\"test pdf\\",\n \\"folderid\\" \\"{{parent folder id}}\\",\n \\"externalid\\" \\"{{external id from get upload session}}\\",\n \\"size\\" 12345\n}") response = https request(request) puts response read body import requests import json url = "https //api cloudfiles io/v1/files?library=cloudfiles\&library=cloudfiles" payload = json dumps("{\n \\"name\\" \\"test pdf\\",\n \\"folderid\\" \\"{{parent folder id}}\\",\n \\"externalid\\" \\"{{external id from get upload session}}\\",\n \\"size\\" 12345\n}") headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses