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.

  1. Launch Identity Management in a browser.

    • In Control Center, go to ACCOUNT ADMINIdentity & Access.

    • In Control Center, on the CONFIGURE menu go to Manage APIs.

  2. Click New API client for me.

  3. Click Next.

    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.

  4. Enter a name and a description for the client.

  5. 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.

  6. Select READ-WRITE for the access level, then click Submit.

  7. Click New credential.

  8. 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.

  1. Open the file you downloaded in a text editor.

  2. Add a line above the credentials as follows: [default].

    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>.

  3. Save the file in your home directory with the name .edgerc.

Make API calls

For this exercise, you’ll use HTTPie to make a simple dig IP address lookup request with the Diagnostic Tools API.

  1. 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.

  2. Execute a dig command to get IP address information for developer.akamai.com in 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.

  3. Run the Dig command again, choosing a different locationID from 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.

Resources

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.