Highlighted

Issues making requests to get target activities via API

calebwood

12-02-2019

Hi all,

I am working on a project which requires pulling a list of activities using the adobe target API but am having some trouble. I have correctly generated a bearer token and I have the api key and tenant name, but the requests fail due to a 'no such file or directory' error. This is based on the documentation here:

Target API v1.0

And seems to be an issue connecting to the mc.adobe.io domain. Has anyone else had this issue?

thanks!

Replies

Highlighted

Eric_Vidana

12-02-2019

let options = {

    host: 'mc.adobe.io',

    path: '/COMPANY/target/activities',

    json: true,

    headers: {

        'Content-Type': 'application/vnd.adobe.target.v2+json',

        'X-Api-Key': 'X-Api-Key',

        Authorization: 'Bearer ' + 'ACCESS TOKEN'

    }

};

let req = https.get(options, callback);

calebwood

13-02-2019

Hey there, I managed to get the requests working - it didn't seem to be the version of the API that was at fault but seemed to be an issue with the bearer token. After my original one expired I had another one generated which seems to now work ok on the requests, so am chalking this one up to gremlins...