v1/s3/put-object REST API Endpoint
Body Parameters
Body
file
REQUIRED
Loading...
Key
string
REQUIRED
Loading...
ContentType
string
REQUIRED
Loading...
Returns
requestid
string
Loading...
status
string
Loading...
created
string
Loading...
pin
object
Loading...
cid
string
Loading...
name
string
Loading...
origins
array
Loading...
meta
object
Loading...
info
object
Loading...
size
string
Loading...
delegates
string
Loading...
Request
1curl --location 'https://api.quicknode.com/ipfs/rest/v1/s3/put-object' \2--header 'x-api-key: YOUR_API_KEY' \3--form 'Body=@"YOUR_FILE_PATH"' \4--form 'Key="YOUR_FILE_NAME"' \5--form 'ContentType="YOUR_CONTENT_TYPE"'
1curl --location 'https://api.quicknode.com/ipfs/rest/v1/s3/put-object' \2--header 'x-api-key: YOUR_API_KEY' \3--form 'Body=@"YOUR_FILE_PATH"' \4--form 'Key="YOUR_FILE_NAME"' \5--form 'ContentType="YOUR_CONTENT_TYPE"'
1var myHeaders = new Headers();2myHeaders.append("x-api-key", "YOUR_API_KEY");34var formdata = new FormData();5formdata.append("Body", fileInput.files[0], "YOUR_FILE_PATH");6formdata.append("Key", "YOUR_FILE_NAME");7formdata.append("ContentType", "YOUR_CONTENT_TYPE");89var requestOptions = {10method: 'POST',11headers: myHeaders,12body: formdata,13redirect: 'follow'14};1516fetch("https://api.quicknode.com/ipfs/rest/v1/s3/put-object", requestOptions)17.then(response => response.text())18.then(result => console.log(result))19.catch(error => console.log('error', error));20
1var myHeaders = new Headers();2myHeaders.append("x-api-key", "YOUR_API_KEY");34var formdata = new FormData();5formdata.append("Body", fileInput.files[0], "YOUR_FILE_PATH");6formdata.append("Key", "YOUR_FILE_NAME");7formdata.append("ContentType", "YOUR_CONTENT_TYPE");89var requestOptions = {10method: 'POST',11headers: myHeaders,12body: formdata,13redirect: 'follow'14};1516fetch("https://api.quicknode.com/ipfs/rest/v1/s3/put-object", requestOptions)17.then(response => response.text())18.then(result => console.log(result))19.catch(error => console.log('error', error));20
1import requests23url = "https://api.quicknode.com/ipfs/rest/v1/s3/put-object"45payload = {'Key': 'YOUR_FILE_NAME',6'ContentType': 'YOUR_CONTENT_TYPE'}7files=[8('Body',('YOUR_FILE_NAME',open('YOUR_FILE_PATH','rb'),'YOUR_CONTENT_TYPE'))9]10headers = {11'x-api-key': 'YOUR_API_KEY'12}1314response = requests.request("POST", url, headers=headers, data=payload, files=files)1516print(response.text)17
1import requests23url = "https://api.quicknode.com/ipfs/rest/v1/s3/put-object"45payload = {'Key': 'YOUR_FILE_NAME',6'ContentType': 'YOUR_CONTENT_TYPE'}7files=[8('Body',('YOUR_FILE_NAME',open('YOUR_FILE_PATH','rb'),'YOUR_CONTENT_TYPE'))9]10headers = {11'x-api-key': 'YOUR_API_KEY'12}1314response = requests.request("POST", url, headers=headers, data=payload, files=files)1516print(response.text)17
1require "uri"2require "net/http"34url = URI("https://api.quicknode.com/ipfs/rest/v1/s3/put-object")56https = Net::HTTP.new(url.host, url.port)7https.use_ssl = true89request = Net::HTTP::Post.new(url)10request["x-api-key"] = "YOUR_API_KEY"11form_data = [['Body', File.open('YOUR_FILE_PATH')],['Key', 'YOUR_FILE_NAME'],['ContentType', 'YOUR_CONTENT_TYPE']]12request.set_form form_data, 'multipart/form-data'13response = https.request(request)14puts response.read_body15
1require "uri"2require "net/http"34url = URI("https://api.quicknode.com/ipfs/rest/v1/s3/put-object")56https = Net::HTTP.new(url.host, url.port)7https.use_ssl = true89request = Net::HTTP::Post.new(url)10request["x-api-key"] = "YOUR_API_KEY"11form_data = [['Body', File.open('YOUR_FILE_PATH')],['Key', 'YOUR_FILE_NAME'],['ContentType', 'YOUR_CONTENT_TYPE']]12request.set_form form_data, 'multipart/form-data'13response = https.request(request)14puts response.read_body15
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free