Authorization
To access the Community of Information Exchange API’s the client needs to pass along a API Key and also a OAuth2 access token. The following documentation explains who to retrieve an access token.
Requesting a Token
The following is the information on using the OAuth2 token endpoint to get a token.
Rest URL
The following are the URLs for this API.
Environment | URL |
---|---|
Development | POST https://login-dev.mi-cie.org/oauth2/token |
Uat | POST https://login-uat.mi-cie.org/oauth2/token |
Production | POSThttps://login.mi-cie.org/oauth2/token |
Headers
The following will be headers that will need to be supplied
Header | Description |
---|---|
Authorization | If the client was issued a secret, the client must pass its |
ContentType | application/x-www-form-urlencoded |
Body
The following are the body of the request
Value | Description | Example |
---|---|---|
grant_type | This is the grant type this will be client_credentials | client_credentials |
client_id | This will be the client id that was given. | 7n5557odet*****4gcdbh17h |
scope | This is the scope(s) that will be passed in to gain access to the api’s | mi-cie.directory/read |
Example
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=7n5557odet*****4gcdbh17h' \
--data-urlencode 'scope=mi-cie.directory/read'
Response
A access token will be returned. This will be a bearer token that can be passed in the header of other API calls to gain access. Please note that this access token is good for 24 hours. It is recommended that the client caches this token for subsequent calls to the API.
HTTP Status Code | Description | Response Example |
---|---|---|
200 | Successful access token is being returned.
| {
"access_token": "eyJraWQiOiJ*********XbWJ4ZlRieFwvcmZhdE1UbjRleWhTanFHaUFqcGsxXC94aWM9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2bTU1NTdvZGV0cG50Z2VycjRnY2RiaDE3aCIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiY2llLmRpcmVjdG9yeVwvcmVhZCIsImF1dGhfdGltZSI6MTYyMzk0OTI5NywiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfNnJUV3hwUlhLIiwiZXhwIjoxNjI0MDM1Njk3LCJpYXQiOjE2MjM5NDkyOTcsInZlcnNpb24iOjIsImp0aSI6ImJiNDExMTE2LTdhZGItNDM1YS1iNmE0LWY5OTYzYzU1ODliNCIsImNsaWVudF9pZCI6IjZtNTU1N29kZXRwbnRnZXJyNGdjZGJoMTdoIn0.pcK7d2KRUjyGoDHVXkHJFo2bDZC945vWQcLmmtGErh_kwNtTnnEqHZxJawoKu8Vb6vCBl6y34NZ3fvWG_NXyZJB2ET-m-DaXm00OlYISzuL1DVP9gPf29vWtCYcXJet-GxjgVg0QLylnnHpF2NFQIrLmlJLACP1d9inClhVNxaktnZ7ZHdl0opbygXq-Z9o_NDDIJFvnP8WUCSrU1FI9gUA2c9jImJb1p2iUEINbLvTcCUGxUJjucx0Ut73dwyMjuuNtXgixthDWsn4DKoZNq2t3nj86-nsSsQ_8mRkFwvOsPVE80FNughlnb3j6TDwcalnXzcx0FMOrYS2BMyqKWw",
"expires_in": 86400,
"token_type": "Bearer"
}
|
Example CURL for this API Call
The following is an example CURL for calling this api. Also note that we have a few sample Referral Id’s that are in our development environment that can be used for testing purposes
curl --location --request POST 'https://login-dev.mi-cie.org/oauth2/token' \
--header 'Authorization: Basic Nm01N*******OWkzMHJ1Y3FyNWVvcGR1Z2YwaGduMXNn' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=7n5557odet*****4gcdbh17h' \
--data-urlencode 'scope=mi-cie.directory/read'