Terug naar Webdesign
Watson
Quickstart
To authenticate with a service's API by using an access token, complete the following steps:[1]
1 - First, create an IBM Cloud API key if you have not already.
2 - The next step for the API client is the retrieval of an IAM access token, as described in Getting an IAM token from an API key.
3 - From the response, extract the property access_token to get the IAM access token. expires_in indicates the seconds until the IAM access token access_token expires. Either use this relative value or the absolute time stamp expiration based in UNIX time.
4 - Send the IAM access token as described in RFC 6750, section 2.1. Authorization Request Header Field:
Review the following example:
1 - Use the HTTP header Authorization
2 - Prefix the IAM access token with the literal Bearer: Bearer eyJhbGciOiJSUzI1Ng...
3 - Add the prefixed IAM access token to the HTTP header: Authorization: Bearer eyJhbGciOiJSUzI1Ng....