Deprecation Warning

DSP API v1 will continue to receive critical bug and security fixes, but no new functionality will be added going forward. Next version of DSP API is under development and when ready DSP API v1 will be deprecated.

Files

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

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
apikey Query Yes API key for authentication and authorization secretkey123

Response JSON Body

Parameter Parameter Type Description Example
top level Array of Files files See below

File Object

Parameter Parameter Type Description Example
id String Id of file 86b35328-794c-11e4-8425-daf437376fff
name String Name of file soap_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

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
fileId Path Yes Id of file 86b35328-794c-11e4-8425-daf437376fff
apikey Query Yes API key for authentication and authorization secretkey123

Response JSON Body

Parameter Parameter Type Description Example
id String Id of file 86b35328-794c-11e4-8425-daf437376fff
name String File name "soap_april_2018.jpg"
state String File state "PROCESSED"
url String URL of the file "https://test.com/files/0003/006/4328479.jpg"
checksum String Checksum (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

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
apikey Query Yes API key for authentication and authorization secretkey123

JSON body

Parameter Type Required Description Example
name String Yes File name "myimage.jpg"
payload String Yes Base64 encoded bytes of the file See 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

Last modified: Mon Sep 23 2024 11:48:54 GMT+0200 (Central European Summer Time)

results matching ""

    No results matching ""