To test the deployed helloworld
API, click the Terminal tab in Apigee in Cloud Code and enter the following curl call:
curl 0:8998/helloworld
The following error message is displayed:
Because you enabled API key-based authentication when creating the API proxy, you need to pass an API key using the apikey
query parameter when calling the API.
To obtain an API key, you need to create a test bundle and configure the following test resources:
API product used to bundle the API and make it available to developers.
Developer that will create an app to access the API.
Developer app that will enable access to the API using an API key.
The Create test bundle wizard opens.
The test bundle is created.
The Create API product wizard opens.
The products.json
file is opened in the editor with the new API product configured:
[ { "attributes": [ { "name": "sample_attribute_0", "value": "sample_attribute_value_0" } ], "scopes": [], "environments": [], "apiResources": [ "/", "/*", "/**" ], "quota": "100", "quotaInterval": "1", "quotaTimeUnit": "minute", "name": "myproduct", "displayName": "myproduct", "proxies": [ "helloworld" ] } ]
The Create developer wizard opens.
The developers.json
file is opened in the editor with the new developer configured:
[ { "attributes": [ { "name": "sample_attribute_0", "value": "sample_attribute_value_0" } ], "email": "ahamilton@example.com", "userName": "ahamilton", "firstName": "Alex", "lastName": "Hamilton" } ]
The Create developer app wizard opens.
The developerapps.json
file is opened in the editor with the new app configured:
[ { "attributes": [ { "name": "sample_attribute_0", "value": "sample_attribute_value_0" } ], "developerEmail": "ahamilton@example.com", "name": "myapp", "displayName": "myapp", "callbackUrl": "", "apiProducts": [ "myproduct" ], "expiryType": "never" } ]
Position the cursor over the mytestbundle test bundle and click .
The active test resources appears in the Apigee Emulators section, as shown in the following figure.
Obtain the API key credentials for your developer app:
The active developer apps configuration file is opened in the editor. The file contains credentials for myproduct
, as highlighted in the following figure.
consumerKey
value (without the quotes) for the myproduct
API product. Test your API with the API key:
apikey
query parameter, as follows: curl 0:8998/helloworld?apikey=API_KEY
The following response is returned:
Hello, Guest!
Congratulations! You've successfully run an API in your local environment.
In the next step, you'll learn how to change the target endpoint.
1234(NEXT) Step 5: Change the target endpoint678
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-24 UTC.