Edit the API response | Community
Skip to main content
Level 2
June 26, 2019

Edit the API response

  • June 26, 2019
  • 1 reply
  • 4329 views

We are looking to optimize our integration with the Adobe Campaign API and are wondering if we are able to change the response Adobe Campaign is giving on certain calls. I.e. for retrieving a session token, the response is quite big and bloated. Is there a way to trim this down and only give back the session token?

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Jonathon_wodnicki
Community Advisor
Community Advisor
June 26, 2019

Hi,

Create your own API using a schema def, proxied to the desired API via js/jsapi.

Thanks

-Jon

Level 2
June 27, 2019

Thanks! That does make a lot of sense.

In this case I would like to do it for the initial call for retrieving a session token. Can I get the .js somewhere, so I can repurpose it and don't need to write everything from scratch?

Jonathon_wodnicki
Community Advisor
Community Advisor
June 27, 2019

Hi,

For schema cus:api, use this js:

function cus_api_Logon (login, password, parameters) {

    return xtk.session.Logon.apply(this, arguments).sessionToken;

}

Thanks,

-Jon