Forum Discussion

CarolineS's avatar
3 years ago

Basic Postman question w/ Khoros API

Hi ya'll! I am very much a Postman / API newbie, attempting to do some very basic scripting w/ the Khoros API using Postman. I have learned how to get the session key: {{baseURL}}/restapi/vc/auth...
  • MattV's avatar
    3 years ago

    First, get the response in JSON format by adding &restapi.response_format=json to your API call.

    In Postman, click the Tests tab, and paste this code 

    var jsonData = JSON.parse(responseBody);
    postman.setEnvironmentVariable("sessionkey",jsonData.response.value.$);

     

    That will save the API key in the sessionkey variable. You can then use that variable in other API calls.