Testing APIs

You're viewing Apigee X documentation.
View Apigee Edge documentation.

Test APIs as described in the following sections. See also Managing folders and files in an Apigee workspace.

Determining the URL of the API proxy endpoint

The default URL for your API proxy endpoint is as follows:


https://localhost:8998/shopping/cart/addItem
       |_____________| |___________| |_____|
             |              |           |
           host+port    basepath    resource

Configure the host and port for the Apigee Emulator, as described in Configuring the Apigee Emulator host and port settings. By default, the host and port (traffic) default to localhost and 8998, respectively, but may be changed to match the values set during installation.

You define the basepath and resource values when developing your API proxy.

Using curl to test your APIs

To test your APIs using curl, open the Terminal tab and execute a call to your API.

For example:

curl localhost:8998/helloworld

Authenticating using an API key

If your API requires API key based authentication:

  • Build and export the API product, developer, and developer app test resources, as described in Building test resources
  • Click Loaded developer apps in the Active test resources section of the Apigee Emulator and copy the consumerKey value (without the quotes) for the API product, as shown in the following figure.

    Developer apps with the consumerKey value highlighted.

Pass the API key in your curl call, as required by your API. For example, the following curl call passes the API key in the apikey query parameter:

curl localhost:8998/helloworld?apikey=ZQA5euYtNeJ7ZCGCJMpvd6F2BZOmxOzY