Subscribe a directed-campaign account
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"advertiserId": "<string>"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe"
payload = { "advertiserId": "<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({advertiserId: '<string>'})
};
fetch('https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscription": {
"id": "<string>",
"customerId": 4503599627370495,
"advertiserId": "<string>",
"connectionId": "<string>",
"accountId": "<string>",
"sourceId": "<string>",
"providerType": "<string>",
"status": "ACTIVE",
"backfillStart": "2023-11-07T05:31:56Z",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncStatus": "SUCCESS",
"lastSyncError": "Connected provider account could not be synchronized.",
"errorCode": "NOT_FOUND",
"errorField": "account.account_id",
"errorReason": "account_scope_mismatch",
"upstreamCode": "ACCOUNT_NOT_AUTHORIZED",
"lastPresenceSyncedAt": "2023-11-07T05:31:56Z",
"lastPresenceSyncStatus": "SUCCESS",
"lastPresenceSyncError": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
},
"sync": {
"subscriptionId": "<string>",
"mirrored": 4503599627370495,
"retired": 4503599627370495,
"skipped": 4503599627370495,
"errors": [
"Connected provider account could not be synchronized."
],
"errorCode": "NOT_FOUND",
"errorField": "account.account_id",
"errorReason": "account_scope_mismatch",
"upstreamCode": "ACCOUNT_NOT_AUTHORIZED",
"liveConformanceFaultStage": "campaign"
}
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Storefronts
Subscribe a directed-campaign account
Subscribe an advertiser-mapped adapter account, enumerate its upstream campaigns, and persist one read-only directed campaign per upstream media buy with a one-year historical window.
POST
/
storefront-connections
/
{connectionId}
/
accounts
/
{accountId}
/
directed-campaigns
/
subscribe
Subscribe a directed-campaign account
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"advertiserId": "<string>"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe"
payload = { "advertiserId": "<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({advertiserId: '<string>'})
};
fetch('https://api.interchange.io/api/v2/buyer/storefront-connections/{connectionId}/accounts/{accountId}/directed-campaigns/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscription": {
"id": "<string>",
"customerId": 4503599627370495,
"advertiserId": "<string>",
"connectionId": "<string>",
"accountId": "<string>",
"sourceId": "<string>",
"providerType": "<string>",
"status": "ACTIVE",
"backfillStart": "2023-11-07T05:31:56Z",
"lastSyncedAt": "2023-11-07T05:31:56Z",
"lastSyncStatus": "SUCCESS",
"lastSyncError": "Connected provider account could not be synchronized.",
"errorCode": "NOT_FOUND",
"errorField": "account.account_id",
"errorReason": "account_scope_mismatch",
"upstreamCode": "ACCOUNT_NOT_AUTHORIZED",
"lastPresenceSyncedAt": "2023-11-07T05:31:56Z",
"lastPresenceSyncStatus": "SUCCESS",
"lastPresenceSyncError": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
},
"sync": {
"subscriptionId": "<string>",
"mirrored": 4503599627370495,
"retired": 4503599627370495,
"skipped": 4503599627370495,
"errors": [
"Connected provider account could not be synchronized."
],
"errorCode": "NOT_FOUND",
"errorField": "account.account_id",
"errorReason": "account_scope_mismatch",
"upstreamCode": "ACCOUNT_NOT_AUTHORIZED",
"liveConformanceFaultStage": "campaign"
}
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Path Parameters
Storefront connection ID
Storefront connection account ID
Body
application/json
Subscribe a mapped provider account for read-only tracked-campaign mirroring.
Response
Subscribe a directed-campaign account
The durable subscription plus the initial one-year mirror reconciliation.