Use Postman for Akamai Open APIs

Jose Pacheco
Oct 15, 2019 · 3 min read

Use the following guide to setup your Postman client for Akamai.

Start off by creating a new collection and adding a GET request to: https://{{baseURL}}/diagnostic-tools/v2/ghost-locations/available

The double curlies around baseURL indicate that it is a variable. It will get populated by the value of the active environment.

Create a diagnostic GET request

Next, we need to create a new environment with our Akamai API credentials. Click on the gear icon and create a new environment.

Add new environment

Create the variables pictured below and fill with your own API credentials (same values as ~/.edgerc file). Make sure “initial value” and “current value” are set. Also, add an empty authorizationHeader field — we will add some code to populate its value later.

You can use these Akamai training values to debug.

Your environment should look like this

Save the environment and close the Manage Environments panel. On the top right, select the environment from the drop-down box to make it active.

Click on the Headers tab directly under the URL field. Add the Authorization header with a value of {{authorizationHeader}}.

Finally, we need to add a pre-request script to populate the value of the authorizationHeader before sending the request. We can add the script in the Pre-request Script tab but its best to add it either at a collection or folder level so you won’t have duplicate code.

Click on the three dots icon next to the collection and select Edit.

Edit a collection

Select the Pre-request Scripts tab and paste in the following code: http://netstorage.edge.akau.webperf.it/content/postman/akam_pre_request.js

Click Save and now attempt the request.

A successful request for diagnostic endpoint

If that didn’t work, click on the eye icon and confirm each variable has a current value populated.

This is largely based on https://developer.akamai.com/blog/2018/01/10/using-postman-test-akamai-apis but with a slight improvement by moving the Pre-request script to a collection level.

Jose Pacheco

Written by

code monkey by day, code monkey by night.

More From Medium

Also tagged Api Development

Also tagged Api Development

GraphQL Resolvers in Apollo

102

Top on Medium

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade