Upload API
Three APIs are available for uploading assets.
When uploading assets to Pixelbin, certain restrictions apply. Learn More
File Upload API
The following endpoint provides file upload functionality.
- Curl
curl --request POST "https://api.pixelbin.io/service/platform/assets/v1.0/upload/direct" \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer BASE_64_ENCODED_API_TOKEN' \
--header 'x-ebg-param: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--header 'x-ebg-signature: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--form 'file=@"/Path/to/file.jpeg"'
Required Headers
All requests should contain the Authentication Signature
Request Body Schema
The body should be of type multipart/form-data
.
file
: FileReadStreampath
: Path to upload folder on Pixelbinname
: Name for the file to be uploadedtags
: Array. Tags to be associated with the assetmetadata
: Object. Metadata to be stored with the assetoverwrite
: Boolean. Iftrue
, overwrites if file exists with the same name.filenameOverride
: Boolean. Iftrue
, appends the name if filename already exists.
Response
200
On SUCCESS, api responds with details of the created file.
400
Bad Request, api responds with the reason for rejection.
Url Upload API
The following endpoint provides file upload functionality.
- Curl
curl --request POST 'https://api.pixelbin.io/service/platform/assets/v1.0/upload/url' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: <REFER-AUTH-API-TOKEN-IN-INTRODUCTION>' \
--header 'x-ebg-param: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--header 'x-ebg-signature: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--data-raw '{ "url": "https://cdn.pixelbin.io/v2/old-scene-ccdc01/original/2-Figure2-1-(1)-transformed.webp", "filenameOverride": true}'
Required Headers
All requests to Pixelbin should contain the Pixelbin Signature
Request Body Schema
The body should be of type application/json
.
url
: String. url of the asset to be uploaded.path
: Path to upload folder on Pixelbinname
: Name for the file to be uploadedtags
: Array. Tags to be associated with the assetmetadata
: Object. Metadata to be stored with the assetoverwrite
: Boolean. Iftrue
, overwrites if file exists with the same name.filenameOverride
: Boolean. Iftrue
, appends the name if filename already exists.
Response
200
On SUCCESS, api responds with details of the created file.
400
Bad Request, api responds with the reason for rejection.
Signed Url Upload API
The following endpoint provides file upload functionality.
- Curl
curl --request POST 'https://api.pixelbin.io/service/platform/assets/v1.0/upload/signed-url' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: <REFER-AUTH-API-TOKEN-IN-INTRODUCTION>' \
--header 'x-ebg-param: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--header 'x-ebg-signature: <REFER-PIXELBIN-SIGNATURE-GENERATION>' \
--data-raw '{ "name": "asset"}'
Required Headers
All requests to Pixelbin should contain the Pixelbin Signature
Request Body Schema
The body should be of type application/json
.
path
: Path to upload folder on Pixelbinname
: Name for the file to be uploadedtags
: Array. Tags to be associated with the assetmetadata
: Object. Metadata to be stored with the assetoverwrite
: Boolean. Iftrue
, overwrites if file exists with the same name.filenameOverride
: Boolean. Iftrue
, appends the name if filename already exists.
Response
200
On SUCCESS, api responds with an s3PresignedUrl
object. It has two parts, url
and fields
.
s3PresignedUrl
object can be used for uploading directly to the Pixelbin Storage directly from the frontend.
A POST request can be used with this url
with a FormData Body. The first field has to be the File Object to be uploaded.
Add the entries in the fields
object in the same order to the Body.
400
Bad Request, api responds with the reason for rejection.