Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Issues making requests to get target activities via API

calebwood
Level 1
Level 1

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!

3 Replies
Eric_Vidana
Level 8
Level 8

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
Level 1
Level 1

Hi there, thanks for the response - will check this out and see if it works.

cheers

Caleb

calebwood
Level 1
Level 1

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...