Page tree

Client API v1

Skip to end of metadata
Go to start of metadata

Retrieves an access token for subsequent calls to other endpoints within this API.

Refer to Authentication for more information regarding the use of access tokens.

Request

URI

/security/authenticate

URI Parameters

None

Authentication

Requires a username and password to be passed in the request body JSON. The username and password will be provided by Critical Mix when you are on-boarded to the API.

Supported Verbs

POST

Request Headers

Name

Value

Description

Content-Type

application/json

MIME type of the request body

Accept

application/json

Expected MIME type of the response body

Request Data 

NameTypeDescriptionNullable
usernamestringUsername provided by Critical MixNo
passwordstringPassword provided by Critical MixNo

Request Examples

Python

import requests
import json

uri = https://client-api.oneopinion.com/security/authenticate
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
}
payload = {
    "username": "ff4e9fbe-e516-9114-1ee3-55bcaf265c79",
    "password": "...secret..."
}
response = requests.post(uri, headers=headers, json=payload)

 

Success Response

HTTP Status Code

200: OK

Success Response Headers

NameValueDescription
Content-Typeapplication/jsonMIME type of the response body

Success Response Data

NameTypeDescriptionNullable
accessTokenstringAccess token to be used in subsequent calls to the APINo

Success Response Examples

HTTP/1.1 200 OK

{
    "accessToken": "...token..."
}


Error Response

HTTP Status Code

Refer to the Error Responses section on the Client API page for more information about Error Responses including the Headers and Body details.

The following status codes may be returned for errors specific to this endpoint:

HTTP Status Codes

Usage

404: Not Found

The username and/or password are invalid, or those parameters are missing from the request body.

Error Response Examples

HTTP/1.1 404 Not Found

{
	"timestamp": 1532719474121,
    "status": 404,
	"error": "Not Found",
    "exception": "com.criticalmix.sampleclientapi.authentication.exception.NotFoundException",
	"message": "No message available",
    "path": "/security/authenticate"
}

 

 


Write a comment…