Skip to main content
POST
/
campaigns
/
{campaignId}
/
creatives
/
placements
Batch-reassign brought creatives to placements
curl --request POST \
  --url https://api.interchange.io/api/v2/buyer/campaigns/{campaignId}/creatives/placements \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mappings": [
    {
      "creative_id": "<string>",
      "format_ids": [
        {
          "agent_url": "<string>",
          "id": "<string>"
        }
      ]
    }
  ]
}
'
import requests

url = "https://api.interchange.io/api/v2/buyer/campaigns/{campaignId}/creatives/placements"

payload = { "mappings": [
{
"creative_id": "<string>",
"format_ids": [
{
"agent_url": "<string>",
"id": "<string>"
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mappings: [
{creative_id: '<string>', format_ids: [{agent_url: '<string>', id: '<string>'}]}
]
})
};

fetch('https://api.interchange.io/api/v2/buyer/campaigns/{campaignId}/creatives/placements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "coverage": {
    "total_placements": 0,
    "covered_placements": 0
  },
  "files": [
    {
      "file_id": "<string>",
      "filename": "<string>",
      "detected": {
        "dimensions": "<string>",
        "duration": "<string>",
        "codec": "<string>",
        "bitrate": "<string>",
        "frameRate": "<string>",
        "sampleRate": "<string>",
        "container": "<string>",
        "fileSize": "<string>",
        "tagType": "<string>"
      },
      "suggestion": "<string>",
      "preview_url": "<string>",
      "message": "<string>",
      "suggestions": [
        "<string>"
      ],
      "accepts_context": true,
      "placements": [
        {
          "placement_id": "<string>",
          "placement_name": "<string>",
          "product_name": "<string>"
        }
      ]
    }
  ],
  "campaign_id": "<string>",
  "campaign_name": "<string>",
  "missing_placements": [
    {
      "placement_id": "<string>",
      "placement_name": "<string>",
      "spec_label": "<string>",
      "product_name": "<string>"
    }
  ],
  "available_placements": [
    {
      "placement_id": "<string>",
      "placement_name": "<string>",
      "spec_label": "<string>",
      "product_name": "<string>"
    }
  ],
  "truncated": true,
  "unreadable_placements": 4503599627370496,
  "skipped_files_notice": "<string>",
  "skipped_files": [
    "<string>"
  ]
}
{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}
{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}
{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}

Authorizations

Authorization
string
header
required

API key or access token

Path Parameters

campaignId
string
required

Body

application/json
mappings
object[]
required
Required array length: 1 - 50 elements

Response

Batch-reassign brought creatives to placements

coverage
object
required
files
object[]
required
campaign_id
string
campaign_name
string
missing_placements
object[]
available_placements
object[]
truncated
boolean
unreadable_placements
integer
Required range: 1 <= x <= 9007199254740991
skipped_files_notice
string
skipped_files
string[]