Archive Campaigns
curl --request POST \
--url https://omnicommerce.sg/api/v1/campaigns/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignIds": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignIds: ['<string>']})
};
fetch('https://omnicommerce.sg/api/v1/campaigns/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/campaigns/archive"
payload = { "campaignIds": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"campaignIds": [
"<string>"
],
"succeededCount": 4503599627370495,
"failedCount": 4503599627370495,
"results": [
{
"success": true,
"campaignId": "<string>",
"stage": "draft",
"error": "<string>"
}
]
}Campaigns
Archive Campaigns
Archive campaigns, or restore archived campaigns by id or by the current archived list filters. Requires promotions:write.
POST
/
api
/
v1
/
campaigns
/
archive
Archive Campaigns
curl --request POST \
--url https://omnicommerce.sg/api/v1/campaigns/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignIds": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignIds: ['<string>']})
};
fetch('https://omnicommerce.sg/api/v1/campaigns/archive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/campaigns/archive"
payload = { "campaignIds": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"campaignIds": [
"<string>"
],
"succeededCount": 4503599627370495,
"failedCount": 4503599627370495,
"results": [
{
"success": true,
"campaignId": "<string>",
"stage": "draft",
"error": "<string>"
}
]
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Body
application/json
- Option 1
- Option 2
Response
Aggregate result plus one result per campaign. success is true only when every requested campaign succeeds.