Viewing code snippets of REST APIs

You can view the sample code snippets for the REST API resources.

About this task

When you want to call any endpoint from a REST API, you can view the sample code to call the endpoint in a language of your choice.

Procedure

  1. From the API gallery page, click the view icon View icon next to an API.
    The API details screen appears.
  2. Select an API resource.
  3. Turn the Show code slider on to view the sample code for the selected resource.
    You can also select a language for the code snippet.
  4. Click Copy to copy the sample code.
  5. Turn off the Show code slider to hide the sample code.