Files can be posted for use in e.g. native ad declarations. The only supported file types are jpg, gif and png.

Contact your Delta Projects representative to get your mediaAgencyId!

List Files

Description: List files for client
Verb: GET
Path:
/api/v1/media_agency/<mediaAgencyId>/client/<clientId>/file

Request Parameters

ParameterTypeRequiredDescriptionExample
mediaAgencyIdPathYesId of media agency86b35325-794c-11e4-8425-daf437376f87
clientIdPathYesId of client86b35326-794c-11e4-8425-daf437376f87
apikeyQueryYesAPI key for authentication and authorizationsecretkey123

Response JSON Body

ParameterParameter TypeDescriptionExample
top levelArray of FilesfilesSee below

File Object

ParameterParameter TypeDescriptionExample
idStringId of file86b35328-794c-11e4-8425-daf437376fff
nameStringName of filesoap_april_2018.jpg

Example Request

GET /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/file?apikey=secret123

Example Response

[
  {
    "id": "86b35328-794c-11e4-8425-daf437376eee",
    "name": "soap_april_2018.jpg",
  },
  {
    "id": "86b35328-794c-11e4-8425-daf437376fff",
    "name": "cat_food_may_2018.jpg",
  }
]

Retrieve File

Description: Retrieve given file
Verb: GET
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/file/<fileId>

Request Parameters

ParameterTypeRequiredDescriptionExample
mediaAgencyIdPathYesId of media agency86b35325-794c-11e4-8425-daf437376f87
clientIdPathYesId of client86b35326-794c-11e4-8425-daf437376f87
fileIdPathYesId of file86b35328-794c-11e4-8425-daf437376fff
apikeyQueryYesAPI key for authentication and authorizationsecretkey123

Response JSON Body

ParameterParameter TypeDescriptionExample
idStringId of file86b35328-794c-11e4-8425-daf437376fff
nameStringFile name"soap_april_2018.jpg"
stateStringFile state"PROCESSED"
urlStringURL of the file"https://test.com/files/0003/006/4328479.jpg"
checksumStringChecksum (SHA1) of the file content"43EFE823A24AF16F8D596F414A695E82414C1D80"

Available File States:

  • "PROCESSED"
  • "PROCESSING"
  • "UNPROCESSABLE"

Note that attempts to fetch a file by using the URL of the file for a file whose state is not "PROCESSED" may fail.

Example Request

GET /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/file/86b35328-794c-11e4-8425-daf437376fff?apikey=secret123

Example Response

{
  "id": "86b35328-794c-11e4-8425-daf437376fff",
  "name": "soap_april_2018.jpg",
  "state": "PROCESSED",
  "url": "https://test.com/files/0003/006/4328479.jpg",
  "checksum": "43EFE823A24AF16F8D596F414A695E82414C1D80",

}

Upload File

Description: Upload a file
Verb: POST
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/file

Request Parameters

ParameterTypeRequiredDescriptionExample
mediaAgencyIdPathYesId of media agency86b35325-794c-11e4-8425-daf437376f87
clientIdPathYesId of client86b35326-794c-11e4-8425-daf437376f87
apikeyQueryYesAPI key for authentication and authorizationsecretkey123

JSON body

ParameterTypeRequiredDescriptionExample
nameStringYesFile name"myimage.jpg"
payloadStringYesBase64 encoded bytes of the fileSee below

Response

HTTP 202 Accepted with the id of the file in the Location header.

The uploaded file will be asynchronously processed. Status of the process can be viewed by retrieving the file.

Example Request

POST /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/file?apikey=secret123

Request Body

{
  "name":"myimage.jpg",
  "payload": "PAYLOAD-FOR-MYIMAGE.JPG"
}

Example Response

Location: 4a2a6200-e1d9-4758-8178-c43f992a391f