Get Started with APIs
Create credentials in Control Center and make API calls over the Akamai network.
These instructions show you how to create an API client and configure credentials so you can use Akamai APIs and the Akamai CLI. An API client contains authentication tokens that secure the interactions between your application and the Akamai platform.
Before you begin
You need access to Control Center with permission to manage API authorizations. If you don’t have this permission, contact an Akamai administrator within your company and ask them to create the API credentials for you.
Install the EdgeGrid HTTPie plug-in. The HTTPie command-line client is an easy way to make API calls.
Create an API client
You need to create an API client in Control Center for each Akamai API you want to use.
If your Control Center administrator gave you credentials for the API, skip to add credential to edgerc file.
Launch Identity Management in a browser.
In Control Center, go to ACCOUNT ADMIN ⇒ Identity & Access.
In Control Center, on the CONFIGURE menu go to Manage APIs.
Click New API client for me.
NOTE: When you create an API client to access an Akamai service, the authentication token inherits permissions associated with the Control Center username. This includes information about the roles and permissions, along with the level of access to specific functions. Review the Identity and Access Management documentation to learn more about the access control model.
Enter a name and a description for the client.
Search for the Diagnostic Tools API.
NOTE: For this exercise, you’ll only use one API, but you could create a credential set that includes several APIs and specify different access levels for each.
Select READ-WRITE for the access level, then click Submit.
Click New credential.
On the New credentials screen, click Download client tokens.
Add credential to edgerc file
Before you can use the API, you need to configure the file that contains the credentials. The credential set includes the client token and client secret required to authenticate Akamai API requests.
Open the file you downloaded in a text editor.
Add a line above the credentials as follows:
NOTE: You can add credentials to this file as needed. Separate each set of credentials with a
[header]as shown. Then, within the syntax of your API calls, you can specify which section of the .edgerc file contains the related credential set like this:
http --auth-type edgegrid -a <section_name>: :/<api_endpoint>.
Save the file in your home directory with the name
Make API calls
For this exercise, you’ll use HTTPie to make a simple dig IP address lookup request with the Diagnostic Tools API.
Request the locations of servers in the Akamai network that can run the diagnostic tools.
$ http --auth-type edgegrid -a default: :/diagnostic-tools/v2/ghost-locations/available
STEP RESULT: You receive a 200 OK response with the location results.
Execute a dig command to get IP address information for
developer.akamai.comin one of the locations. For this example, use Perth, WA, Australia (perth-wa-australia).
NOTE: Dig (domain information groper) is a command-line tool for querying Domain Name System (DNS) servers.
$ http --auth-type edgegrid -a default: ":/diagnostic-tools/v2/ghost-locations/perth-wa-australia/dig-info?hostName=developer.akamai.com&queryType=A"
STEP RESULT: You receive a 200 OK response with the dig results.
Run the Dig command again, choosing a different
locationIDfrom the Ghost location results. For more information, refer to the Run dig from a Ghost Location operation.
Congratulations, you learned how to create an API client, configure credentials to access Akamai APIs, and execute API calls!
NOTE: If you need to create a client to manage multiple accounts, refer to the Manage many accounts with one API client guide.
In this exercise, you discovered how easy it is to make API calls with Akamai. Here are some resources you can use to extend these skills and apply them to improve your web application delivery and performance.
Explore the APIs available in the Akamai API Catalog.
Get started with the CLI so you can manage and configure Akamai’s platform from the command line.
Engage with other developers in the Akamai Developer Community.
Download an Open Source API Client that matches your preferred development language.