Authentication
Before do any request, we must call to an API to get accessToken for authenticate an user for each request
Authentication URL: ( Get the link from Contemi ).
https://seamless-integration-trial.auth.eu-west-2.amazoncognito.com/token
Method: POST
Header:
...
Obtain an access token:
Code Block | ||
---|---|---|
| ||
curl https://AUTH_BASE_URL/oauth2/token \ -X POST \ -H "Content-Type: application/x-www-form-urlencoded |
...
Body:
" \ -d "grant_type |
...
=client_credentials |
...
&client_id |
...
={CLIENT_ID}&client_secret |
...
Note: above client_id, client_secret value is an example, we can get it on Seamless website
Postman example (please see it on the attachments):
...
...
={CLIENT_SECRET}" |
You can get the AUTH_BASE_URL
from the Seamless team.
The CLIENT_ID
and CLIENT_SECRET
can be obtained from the Applications page on the Seamless website.
Sample response:
Code Block | ||
---|---|---|
| ||
{"access_token":"...","expires_in":3600,"token_type":"Bearer"} |
Make API requests using the obtained access token:
Code Block | ||
---|---|---|
| ||
curl "https://external-api.staging.contemisaasdev.com/underwriting/api/v1/policies" \
-H 'Content-Type:application/vnd.api+json' \
-H 'Accept:application/vnd.api+json' \
-H 'Authorization: {ACCESS_TOKEN}' |