Building Google Cloud Platform Solutions
上QQ阅读APP看书,第一时间看更新

Google APIs Explorer

A challenge that arises when dealing with so many disparate APIs is that the sheer number of request and response models can be overwhelming. To aid developers in interacting with these APIs, Google offers the Google APIs Explorer (https://developers.google.com/apis-explorer). As with the API Library, the APIs Explorer includes APIs for a range of Google products, and it is not limited to Google Cloud APIs.

The APIs Explorer offers developers a straightforward interface where you can:

  • Search for APIs by products and services
  • Browse the methods available for an API
  • Authenticate against an API and grant specific authorization scopes
  • Execute requests for a given API method and view the response

When you've found an API method you would like to execute, the APIs Explorer will present a form with the various fields of the request body, along with a description of each field. The form accommodates structures such as nested JSON objects, lists, and dictionaries. Once you've completed filling out the request, you can click on Authorize and execute to fire off a request.

For authorizing the request, the APIs Explorer will present a list of required OAuth2 scopes and allow you to modify these scopes. This can be useful when developing against APIs to see how different permissions affect the request. By default, Google will use the account of the current browser session. Alternatively, you may use a custom API key and OAuth2 client ID by selecting Settings | Set API key / OAuth 2.0 Client ID. You might choose to do this to test that a given set of credentials has been properly configured.