NGINX Modern Apps > Class 10 - NMS API Connectivity Manager > Module 6 - Dev Team - Consume API v2.0 Source | Edit on
Step 10 - Test the API 2.0 as a Dev API¶
Test API Version 2 with Postman¶
Login to the Developer Portal as
dev1
(password dev1) - if the cookie is still there, authentication will be transparent (thanks to OIDC)Click on
App Credentials
and click your organization (nginx)Click
Create Credential
Use
sentence2
for the App name, and selectsentence-api v2
for the API.Copy the new Key and open
Postman
Select
GET Colors
, add your API key in Authorization, and send the RequestNote
Request fails with a 403 response code.
Note
As you can notice, as /colors is not part of the v1, the API Gateway denied the request. The URI path needs to be corrected. It must be
/v2/api/
While in Postman, modify the request to
http://api.sentence.com/v2/api/colors
and send it -> it passesLet’s try to send a request to
/animals
from version 1Note
It works because the gateway knows, thanks to the /v1 or /v2 prefixes, which API Proxy to use. You can try to change /animals to v2. It will work as this endpoint also exists in v2. Be sure to utilize the correct API Key in the Postman authorization. If you did not test with the
/animals
endpoint earlier in the lab, you will need to add the API key for authorization.
Test API Version 2 with Dev Portal¶
In Developer Portal, re-login (refresh the browser first)
Go to APIs doc, and select
v2
Select
GET /colors
endpoint, andtry it out
Select the
sentence2
credential and send the request
Note
In this lab, we saw how to update an existing API Proxy with a new version and how the gateway behaves with different versions up and running