Hi there,
I’m seeing this error coming back while trying to set up a search trigger.
Invalid API Response: - Got a result missing the "id" property
{"message": "OK", "code": 0, "data": {"list": t{"advertiser_id": xxxxxx, "advertiser_name": "xxxxxx"}]}, "request_id": "xxxxxx"}
Does anyone have any examples of how to give it an id? Perhaps using advertiser_id
, or equivalent?
Here’s my current code:
const options = {
url: 'https://ads.xxxxxx.com/open_api/v1.2/oauth2/advertiser/get/',
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${bundle.authData.access_token}`
},
params: {
'access_token': bundle.authData.access_token,
'app_id': process.env.CLIENT_ID,
'secret': process.env.CLIENT_SECRET
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
I’m guessing I’ll also need to have it accessing the nested data using something like results.data.list
Any help appreciated!
Thanks