Postman is a popular tool that lets you build and test API requests.

After you install Postman, clicking Postman Collection for our XML API will automatically import our collection of XML APIs into your Postman application. You can then begin using and modifying the example payloads to suite your needs. You can also save specific payloads to your application and easily submit them whenever needed.

Update the operation “Generate an Access Token” with your WCA-created credentials to easily generate access tokens for API access to your organization.

Note:

Remember to replace the X in each URL with your Pod number, i.e. if your organization is on Pod 5, you should change your URLs to api5.ibmmarketingcloud.com before submitting.

Optional:

Our XML API collection comes with a Postman variable within the Authorization header in the form of {{access_token}}. You can certainly remove that place holder and paste in your newly generated access token from the response of the “Generate an Access Token” request each time access is needed. Or, you can choose to create an Environment variable within your Postman application that will store the value of your OAuth access token.

Additional information regarding Postman variables and environments can be found below:

  • Postman Variables
  • Postman Manage environments


  • If you do create an “access_token” Environment variable, simply navigate to the “Generate an Access Token” request, select the tab labelled Test, and paste in the following JavaScript snippet:

    var jsonData = JSON.parse(responseBody);
    pm.environment.set(“access_token”, jsonData.access_token);

    Postman will now use the value of your access token for as long as the token remains active in every subsequent request you make within the application and without the need to copy and paste the token value each time.

    4 comments on"XML API Postman Collection"

    1. Michael Hobley March 28, 2018

      This information appears to be outdated. Using the provided code:

      var jsonData = JSON.parse(responseBody);
      postman.setEnvironmentVariable(“access_token”, jsonData.access_token);

      results in an error. It appears Postman has made changes since this was published. It should now be:

      var jsonData = JSON.parse(responseBody);
      pm.environment.set(“access_token”, jsonData.access_token);

      • Hello Michael,
        I am confirming this information and will get back to you.

        Thank you,
        Jeri

      • Hello Michael,
        Thank you for your patience as I awaited confirmation for the above update. This update has been made.

        Thank you
        Jeri

    2. Christophe P June 20, 2018

      Hello,
      could we please have the GDPR Postman commands now they are available ?
      Thanks

    Join The Discussion

    Your email address will not be published. Required fields are marked *