Media Uploads

Media Upload Model

Attributes

  • id

    string

    The Media Upload's unique identifier.

  • accountId

    string

    The Media Upload's owning Centrapay Account id.

  • mimeType

    string

    The media (MIME) type of the upload.

  • fileName

    string

    The file name of the upload.

  • createdAt

    timestamp

    When the Media Upload was created.

  • createdBy

    crn

    The User or API Key that created the Media Upload.

  • updatedAt

    timestamp

    When the Media Upload was updated.

  • updatedBy

    crn

    The User or API Key that updated the Media Upload.

  • uploadUrl

    string

    A presigned URL that gives users time-limited permission to upload media.


Create a presigned URL for Media Upload experimental

This endpoint allows you to upload a media file to Centrapay. It returns a presigned URL that can be used to download the media file.

Attributes

  • accountId

    string required

    The Media Upload's owning Centrapay Account id.

  • mimeType

    string required

    The media (MIME) type of the upload.

  • fileName

    string required

    The file name of the upload.

Request
curl -X POST \
https://service.centrapay.com/api/media-uploads \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '
{
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"mimeType": "image/png",
"fileName": "image.png"
}
'
Response
{
"id": "DKTs3U38hdhfEqwF1JKoT2",
"uploadUrl": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743"
}

Get Media Upload Location experimental

This endpoint allows you to retrieve the upload location of a media file.

Request
curl -X GET \
https://service.centrapay.com/api/media-uploads/DKTs3U38hdhfEqwF1JKoT2/location \
-H 'x-api-key: <TOKEN>'
Response
{
"url": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743"
}