Hi guys, I’m trying to connect a custom Zapier integration and I came across the “Missing ID Property” error.
I’m trying to use the “campaignID” as the “id” to identify the objects for Zapier.
This is the output of the json.
{
"links": {
{
"href": "http://api.sitescout.com/advertisers/81054/campaigns/stats",
"rel": "self"
},
{
"href": "http://api.sitescout.com/advertisers/81054/campaigns/stats?page=2",
"rel": "next"
}
],
"totalCount": 3261,
"results": b
{
"entity": {
"links": {],
"campaignId": 1318933,
"name": "CCBC Click Retargeting April'20",
"campaignGroupId": 269197,
"campaignGroupName": "CCBC April'20 I know do you/Dyer",
"status": "online",
"defaultBid": 4,
"notes": "",
"budget": {
"links": {],
"amount": 60,
"type": "daily",
"evenDeliveryEnabled": true,
"schedule": {
"flightDates": {
"from": "20200401",
"to": "20200430"
}
}
},
"created": "20200401 00:00:00",
"reviewStatus": "eligible",
"portalApprovalStatus": "eligible",
"campaignType": "mobile_retargeting",
"frequencyCapping": {
"impressions": 6,
"periodInHours": 12,
"type": "campaign"
},
"enabledRON": false,
"enabledROP": false,
"enableCrossDevice": false,
"isRelativeDayParting": false,
"kpiValue": "1",
"kpiType": "CTR",
"pacingSetting": "CAMPAIGN",
"excludeAnonymousDomains": false,
"enablePixalateViewability": false,
"impressionPacing": {
"evenDeliveryEnabledForImpressions": false
}
},
"stats": {
"impressionsBid": 0,
"impressionsWon": 0,
"dataCost": 0,
"auctionsSpend": 0,
"totalSpend": 0,
"nonBillableSpend": 0,
"clicks": 0,
"offerClicks": 0,
"clickThroughConversions": 0,
"ctcRevenue": 0,
"viewThroughConversions": 0,
"vtcRevenue": 0,
"totalConversions": 0,
"revenue": 0,
"videoStarted": 0,
"videoFirstQuartileReached": 0,
"videoMidpointReached": 0,
"videoThirdQuartileReached": 0,
"videoCompleted": 0,
"videoSkipped": 0,
"eligibleImpressions": 0,
"viewableImpressions": 0,
"measuredImpressions": 0,
"viewabilitySpend": 0,
"companionImpressions": 0,
"companionClicks": 0,
"companionConversions": 0,
"companionOfferRevenue": 0,
"winRate": 0,
"clickThroughRate": 0,
"offerClickThroughRate": 0,
"conversionRate": 0,
"clickCVR": 0,
"viewCVR": 0,
"videoCompletionRate": 0,
"videoSkippedRate": 0,
"returnOnAdSpend": 0,
"profitPerClick": 0,
"dataEffectiveCPM": 0,
"costPerClick": 0,
"mediaEffectiveCPM": 0,
"costPerAcquisition": 0,
"revenuePerMille": 0,
"clickEffectiveCPA": 0,
"viewEffectiveCPA": 0,
"clickRPM": 0,
"measuredRate": 0,
"viewableRate": 0,
"viewableCPM": 0,
"totalCVRM": 0,
"totalEffectiveCPM": 0,
"totalEffectiveCPCV": 0,
"conversions": 0,
"viewthruConversions": 0,
"clickthruRate": 0,
"offerClickthruRate": 0,
"dataSpend": 0,
"auctionsWon": 0,
"effectiveCPM": 0
},
When I use this code:
const options = {
url: `https://api.sitescout.com/advertisers/${bundle.authData.ad_id}/campaigns/stats`,
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${bundle.authData.access_token}`,
'content-type': 'application/json'
},
params: {
}
}
return z.request(options).then((response) => {
response.throwForStatus();
const result = z.JSON.parse(response.content);
result.id = result.ID;
return .result];
});
This is what comes up:
Invalid API Response: - Got a result missing the "id" property ({"links":p{"href":"http://api.sitescout.com/advertisers/81054/campaigns/stats","rel":"self"},{"href":"http://api.sitescout.com/advertisers/81054/campaigns/stats?page=2","rel":"next"}],"totalCount":3261,"results":n{"entity":{"links":{],"campaignId":13) What happened (You are seeing this because you are an admin): Executing triggers.campaigns.operation.perform with bundle Invalid API Response: - Got a result missing the "id" property ({"links":p{"href":"http://api.sitescout.com/advertisers/81054/campaigns/stats","rel":"self"},{"href":"http://api.sitescout.com/advertisers/81054/campaigns/stats?page=2","rel":"next"}],"totalCount":3261,"results":n{"entity":{"links":{],"campaignId":13) Console logs:
…
And when I use this code:
const options = {
url: `https://api.sitescout.com/advertisers/${bundle.authData.ad_id}/campaigns/stats`,
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${bundle.authData.access_token}`,
'content-type': 'application/json'
},
params: {
}
}
return z.request(options).then((response) => {
response.throwForStatus();
const result = z.JSON.parse(response.content);
result.entity.campaignId = result.id;
return rresult];
});
This is what comes up:
Cannot set property 'campaignId' of undefined What happened (You are seeing this because you are an admin): Starting GET request to https://api.sitescout.com/advertisers/81054/campaigns/stats Received 200 code from https://api.sitescout.com/advertisers/81054/campaigns/stats after 603ms Received content "{"links":e{"href":"http://api.sitescout.com/advertisers/81054/campaigns/stats","rel":"self"},{"href"" Cannot set property 'campaignId' of undefined Console logs:
Does anyone have a possible solution? Thanks so much in advance!