Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: More compact doc. Add curl commands.
  1. 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
languagebash
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
languagejson
{"access_token":"...","expires_in":3600,"token_type":"Bearer"}
  • Make API requests using the obtained access token:

Code Block
languagebash
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}'