Guides
Blobs
Blobs
Usually you can pass a Blob directly into the request but to help guarantee success we recommend passing it into a
File
object.Pin Blob
URL
URL
To upload a file from an external URL you can stream the contents into an
arrayBuffer
, which then gets passed into a new Blob
that can then be uploaded to Pinata.Upload by URL
base64
base64
To upload a file in base64 simply turn the contents into a
buffer
that is passed into a Blob
.Upload base64
Folders
Folders
Folders can also be uploaded via the API by creating an array of files and mapping over them to add them to the form data. This is different then having a single
file
entry and having multiple files for that one entry, which does not work.Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
multipart/form-data
The body is of type object
.
Response
200 - application/json
{ "IpfsHash": "This is the IPFS multi-hash (CID) provided back for your content," "PinSize": "This is how large (in bytes) the content you just pinned is," "Timestamp": "This is the timestamp for your content pinning (represented in ISO 8601 format)" }
The response is of type object
.