Log in to the API Store (
) and click on an API (e.g.,
PhoneVerification1.0.0) to open it.
Tip: In a multi-tenanted API Manager setup, you can access any tenant's store using the URL
Note the subscription options on the API's Overview page.
Click the My Applications menu and create a new application.
Tip: Instead of creating a new application, you can also use the default application.
Go back to the API's subscription options and select the application you just created, a tier and click Subscribe.
Click the Go to My Subscriptions button when prompted. The subscriptions page opens.
Select the application from the drop-down list and click Generate to create an application access token. You can use this token to invoke all APIs that you subscribe to using the same application.
Tip: You can set a token validity period in the given text box. By default, it is set to one hour. If you set a minus value (e.g., -1), the token will never expire.
Install cURL if it is not there in your environment. Note that cURL comes by default in some operating systems. You can also use any other REST client.
Open the command line and execute the following cURL command:
curl -H "Authorization: Bearer <access token>" -v '<API URL>'
Be sure to replace the placeholders as follows:
- <access token>: Give the token generated in step 86
<API URL>: Go to the API's Overview tab in the API Store and copy the production URL and append the payload to it. E.g., http://localhost:8280/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=123456&LicenseKey=0
Here's an example:
curl -H "Authorization :Bearer 8e64c4201d1c311c76a9c540856d1043" -v 'http://localhost:8280/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=123456&LicenseKey=0'
Note the result that appears on the command line. In this example, the phone number is invalid.
Similarly, invoke the POST method using the following cURL command:
curl -H "Authorization :Bearer <your token here>" --data "PhoneNumber=123456&LicenseKey=0" http://localhost:8280/phoneverify/1.0.0/CheckPhoneNumber