Postman
Postman is a graphical user interface that makes it easier to build and use APIs.
When configuring Postman, you can either set it up manually from scratch, or use the ready-made Postman collections and environments we created for your Akamai product and published in the Akamai workspace in Postman.
Set up Postman
You can set up and use Postman in the browser of your choice or get the app from Postman's website for Linux, macOS, and Windows.If you want to fork collections and environments, or follow changes in the original collections, create a free Postman account.
How to set up Postman:
-
Open Postman or go to https://www.postman.com/.
-
Click Create Account.
-
Enter the account details and click Create free account.
-
After creating a Postman account, you can either go directly to your personal workspace or click Explore more collections and look up Akamai’s Public Workspace.
-
Click the link you received via email to activate your account, and use all of Postman’s features.
When signed in, you can access the Akamai dashboard with collections and workspaces anytime at https://www.postman.com/akamai/. You’re now ready to fork an Akamai collection.
Note
If you want to use Postman without setting up an account, you can manually download the Postman collection and environment for Akamai and import it using the Postman client.
Fork a collection
The Akamai API collections are now available in Akamai's Public Workspace. This means you can fork them into My Workspace to configure Postman for Akamai API calls.
If your product doesn’t have a Postman collection yet, or you want to use a new collection, go to Set up a new collection.
To get started, you can fork the collection from Akamai’s workspace:
-
Launch Postman and log in to your account.
-
Go to Akamai's Public Workspace.
-
In the Collections menu, find your product, click … and Create a fork.
- On the Fork collection screen, name your fork in Fork label, and choose the workspace where you want to create the fork in Location.
-
Check the Watch original collection box if you want to get email notifications about any changes to the original collection.
-
Click Fork Collection.
After forking the collection, you'll be redirected to your own API workspace. You can navigate through the Collections tab to get familiar with different operations available for the API you want to use.
To make API calls, you need to authorize them with Akamai API credentials. See how to Create authentication credentials for Akamai.
If you want to optimize your API workflows, you can optionally fork an environment into your own workspace.
Fork an environment (optional)
Optionally, you can also use Postman to fork the Akamai environment template for the API you want to use. Environments come with a set of API-specific variables you don’t have to configure each time you build an API call. You can use them to optimize your API-related tasks and automate workflows.
-
Go to Akamai's Public Workspace.
-
In the Environments menu, find the environment you want to use, click … and Create a Fork.
-
On the Fork collection screen, name your fork in Fork label, and choose the workplace where you want to create the fork in Location.
-
Click Fork Collection.
-
Before you make an API request in Postman, you need to Authenticate a collection with your Akamai credentials.
Authenticate a collection
Each Akamai collection comes with authentication variables set at the collection level. We recommend that you resolve them by setting your authentication credentials as environment variables. To save your time, Akamai environments have these credentials already defined for you.
Before you begin
Before you configure authentication variables, fork an environment from the Akamai public workspace, or create a new environment in Postman.
How to
-
Go to the Credentials section of the Identity and Access Management tool in the Akamai Control Center.
-
Open your Postman environment and copy the client_secret, host, access_token, and client_token values to replace the default variables in the environment. Make sure that the value you copy does not contain extra characters (such as spaces or slashes).
- Go to Collections and switch to the environment you want to work in.
- Choose the Collection for your product from the list, and click Authorization to hover over your authentication details to check if they resolve correctly, and make sure the Type is set to Akamai Edge Grid. If not, choose it from the drop-down list.
After you've configured the authentication for your Akamai collection, you’re ready to make an API request in Postman.
Set up a new collection
If you want to use your own collection or your product doesn’t have a public Akamai collection in Postman yet, you can set up a new collection. This requires configuring authorization and setting up variables manually before making an API request.
Before you begin, get the values from the credential you created in Control Center and apply them in Postman. Refer to Create authentication credentials if you need help.
Follow these steps to create and authenticate a new collection:
- Launch Postman and create a New Collection.
Tip
Postman has the Akamai EdgeGrid authentication method built in to make it easier for you to add your tokens and start using Akamai's APIs.
-
Click the Authorization tab.
-
Select Akamai EdgeGrid from the Type menu.
-
Copy the
client_secret
value from the Credentials section of the Identity and Access Management tool in Control Center. -
Return to Postman and paste it in the Client Secret field.
-
Copy and paste the
access_token
andclient_token
values in their respective fields. -
Click Save.
Next, you need to set up variables for your collection. You can use Postman's Variables feature to assign a reusable value to a variable and call on it whenever you need it. This can help protect sensitive data like your EdgeGrid authentication values, or you can use one to quickly call a fixed value in an API request. Here we cover some optional but recommended variables you can create.
First, let's store the base URL used for all Akamai APIs as a variable. This lets you quickly call on it when making a request, rather than typing it manually each time.
- Copy the Host value from the Credentials section of the Identity and Access Management tool in the Control Center.
-
Back in Postman, click the Variables tab.
-
In a new row, click Add a new variable and enter
base_url
as its name. -
Click the INITIAL VALUE column cell, type
https://
, and paste the rest of the base URL. The CURRENT VALUE column defaults to this same value. Leave it as is. -
Click Save.
More on how to use this variable later. Next, let's hide your Access Token, Client Token, and Client Secret values using variables.
-
With your Collection selected, click the Authorization tab.
-
Copy the value you set as your Access Token.
-
Select the Variables tab. Click Add a new variable in the table. Enter
access_token
as the name. -
Click in the INITIAL VALUE column and paste the access token.
-
Select the Authorization tab and repeat the steps for the Client Token and Client Secret values, naming the variables
client_token
andclient_secret
, respectively. -
Return to the Authorization tab and delete all content in the Access Token field.
-
Enter
{{access
in the Authorization field and select theaccess_token
variable from the drop-down.
-
Enter
{{client
to select the variables for both the Client Token and Client Secret. -
Click Save.
Your token and secret values are now protected from direct view.
After setting up authentication and variables for your new collection, you’re ready to make an API request in Postman.
Make an API request
You can use postmancall
to make requests to an Akamai API straight from the Postman interface. Postman offers several extra features that make it easier to manage complex calls too.
In this example, we're using postmansample
to query the Edge Diagnostics API. We'll view all of the IP addresses assigned to a specific Global Traffic Management (GTM) property.
This example assumes you've set up variables in Postman.
-
Select Collections → {collection-name} and click New Request.
-
Set the method to GET and type
{{base
in the Enter request URL field. -
Select the base_url variable from the drop-down menu.
This inserts the base URL variable. -
Add the list GTM properties endpoint to show the existing revocation list. The full value should look like this:
{{base_url}}/edge-diagnostics/v1/gtm/gtm-properties
-
Click Send. The interface shows the response:
{ "gtmProperties": [ { "property": "origin", "domain": "akadns.net", "hostName": "origin.akadns.net" }, { "property": "origin-r3h", "domain": "akadns.net", "hostName": "origin-r3h.akadns.net" } ] }
-
Find the
hostName
for your GTM property and store itsproperty
anddomain
values. -
Replace the endpoint path with the list IP addresses for a GTM property operation. Keep the
{{base_url}}
variable value in this field. -
Replace the
{property}
and{domain}
variable values with the ones you noted. -
Click Send. The response looks like this:
{ "gtmPropertyIps": { "property": "origin", "domain": "akadns.net", "testIps": [ "1.23.45.678", "191.011.121.314", "15.16.171.81", "192.02.122.23", "24.25.262.72" ], "targetIps": [ "182.93.03.132", "133.34.35.363", "273.83.94.04" ] } }
Now you can review all of the test and target IP addresses that have been assigned to your selected GTM property.
Click Save at the top right to reuse this operation in Postman. You won't have to run the original operation to get the
property
anddomain
values again.
Set up variables
You can use Postman's Variables feature to assign a reusable value to a variable and call on it whenever you need it. This can help protect sensitive data like your EdgeGrid authentication values, or you can use one to quickly call a fixed value in an API request. Here we cover some optional but recommended variables you can create.
First, let's store the base URL used for all Akamai APIs as a variable. This lets you quickly call on it when making a request, rather than typing it manually each time.
-
Copy the Host value from the Credentials section of the Identity and Access Management tool in Control Center..
-
Back in Postman, click the Variables tab.
-
In a new row, click Add a new variable and type
base_url
as its name. -
Click the INITIAL VALUE column cell, type
https://
, and Paste. The CURRENT VALUE column defaults to this same value. Leave it as is. -
Click Save.
More on how to use this variable later. Next, let's hide your Access Token, Client Token, and Client Secret values using variables.
-
With your Collection selected, click the Authorization tab.
-
Copy the value you set as your Access Token.
-
Select the Variables tab. Click Add a new variable in the table. Type
access_token
as the name. -
Click in the INITIAL Value column and Paste.
-
Select the Authorization tab and repeat the steps for the Client Token and Client Secret values, naming the variables
client_token
andclient_secret
, respectively. -
Return to the Authorization tab and delete all content in the Access Token field.
-
Type
{{access
in the Authorization field and select the access_token variable from the drop-down.
-
Type
{{client
to select the variables for both the Client Token and Client Secret. -
Click Save.
Your token and secret values are now protected from direct view.
Find resources for calling Akamai APIs in the Akamai Postman collection.
Next steps
Watch this video for a demonstration of how to create an Akamai delivery configuration using Postman.
Updated about 1 year ago