Expand my Community achievements bar.

Applications for the 2024 Adobe Target Community Mentorship Program are open! Click to the right to learn more about participating as either an Aspirant, to professionally level up with a new Certification, or as a Mentor, to share your Adobe Target expertise and inspire through your leadership! Submit your application today.

Issues making requests to get target activities via API

Avatar

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

Avatar

Community Advisor

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);

Avatar

Level 1

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

cheers

Caleb

Avatar

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