API Consumer
In this section, you will test the new version of the API to ensure that OAuth is working properly.
  1. Open your API Portal in a new browser tab and log in with your developer account.

    If you closed the tab from earlier and don’t have it bookmarked, you can follow these steps to find your API Portal URL:

    Locate and Launch your Portal URL

  2. Click on the API Products tab.

  3. Notice that the old inventory product is no longer available. It has been replaced by your new Think Inventory product.

  4. Click on the Think Inventory product.

  5. Click on the inventory API from the palette menu on the left.

  6. Select the GET /Items operation. Notice that we now have an additional OAuth security requirement defined.

  7. Scroll down to browse the invocation form.

  8. Select your subscribed application from the Client ID drop-down menu.

  9. Paste your secret into the Client secret field.

  10. In the Username and Password fields, you can enter any text.

  11. Click on the Authorize button to obtain an OAuth token.

    The API Portal will call out to the OAuth Token URL with your client credentials and user credentials.

    The OAuth API which you built in lab 3 will intercept the request, validate the credentials, and generate a token.

  12. Click on the Call operation button to invoke the API. The request will include the OAuth bearer token in the Authorization header.

  13. To prove that the token is being validated, you can either remove or modify the contents of the Access Token field, then click the Call operation button again and see the 401 Unauthorized error response.

Continue

Proceed to Lab 5 - Advanced API Assembly.