API Testing Authentication

As there is plenty of documentation available and this is a third party element we will not cover it, but to get this part sorted:

  1. Go to: https://developer.spotify.com/documentation/general/guides/authorization/client-credentials/

  2. Follow the instructions to create your Client ID and Client Secret.

Create the new API REQUEST

  1. Drag the REST REQUEST Block from the left side.

  2. Select the POST Request option from the Drop Down list.

  3. Add the Spotify token Resource Locator (URL) into de appropriate Box of the Block.

Select the authentication

  1. Expand the REST REQUEST BLOCK using the Chevron.

  2. Add the POST request to authentication server. In this case https://accounts.spotify.com/api/token

  3. Select the Authentication tab (the other are Parameters, Header and Body)

Authentication Type

  1. Select OAUTH 2.0 client Credentials

  2. The request will ask for Client ID and Client Secret

NOTE: Remember, you have to follow the instructions from previous slides to obtain Client ID and Client Secret.

Modifying the Header.

  1. Select the “Header” tab

  2. Content-Type Header should be set to: “application/x-www-form-urlencoded"

Sending the request.

  1. Send the request using the “RUN” button.

  2. If all the steps were performed correctly the request will show the “200” Return.

  3. Show the return with he “Object” link.

The outcome

Send the request, and if everything goes well the server will return an access token, Now, knowing the token it can be used in another request. For example getting song details from Spotify (we will try that later)