Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Log in to the API Cloud Store and the API Publisher will open automatically.

  2. Click the Go to API Store link in the top right-hand corner of the API Publisher to open your default API Store.  
    API StoreImage Removed 

    Info

    Tip: You can access any tenant's store using the URL http://<hostname>/Store?tenant=<tenant_name>.

  3. Click the RESTClient menu that appears under the Tools menu in the API Store.
    Image Removed
  4. The REST client opens. Select the GET method and provide the following information in the rest of the fields:

    API URL

    To get the URL, go to the API's Overview tab in the API Store. The URL takes the form http://<host_name>:8280/<context>/<version>/<Resource, if any><back end service requirements included as parameters, if any>. For example, http://gateway.api.cloud.wso2.com:8280/t/yashiracom/phoneverify/1.0.0/CheckPhoneNumber where /phoneverify is the context, 1.0.0 is the version and CheckPhoneNumber is the resource.

    As you are going to make an HTTP GET call in this tutorial, append the payload to the URL. For example, http://gateway.api.cloud.wso2.com:8280/t/yashiracom/phoneverify/1.0.0/CheckPhoneNumber ? PhoneNumber=18006785432&LicenseKey=0 .

    Header

    Authorization:Bearer <give the access token that you generated in step 4>
    E.g, Authorization:Bearer U9znDo4OSYPfzoW16S2puHmKahga

    OAuth security is enforced on all published APIs. Consumers must send the credentials (application access token) as per the OAuth bearer token profile. If not, you receive a 401 Unauthorized response in return.

    Image Removed

  5. Click the Send button to invoke the API. The response appears in the console.
    As select an API (e.g., PhoneVerification 1.0.0.)

  6. Subscribe to the API if you haven't done so already.
     

  7. Choose to go to the My Subscriptions page and generate an access token. If you already have an access token for the application, you have to regenerate it after 1 hour. 

    Let's invoke this API. 

  8. Go to the API Console tab and expand the GET method. 

     

  9. Give values to the parameters and click Try it out to invoke the API.
     

  10. Note the response that appears in the API Console. As we used a valid phone number in this example, the response returns as valid.
    Image Removed

  11. Within a minute after the first API invocation, make another attempt to invoke the API.
  12. Note that you get a throttling error saying that you exceeded your quota. This is because you subscribed to the API on the Bronze throttling tier and the Bronze tier only allows you to make one call to the API per minute.
    Image Removed

  13. In the REST client, select the DELETE method and invoke the API again.

  14. The call gets blocked by the API Gateway. It doesn't reach your backend services as you did not allow the DELETE method for the resource when creating the API.
  15. In the REST client, select the GET method again but this time, give the resource name as CheckPhoneNumbers instead of CheckPhoneNumber.
  16. Again, you get the same 'no matching resource' message that you got in step 9. This is because you are trying to access a REST resource that is not defined for the API.
     

...