Skip to main content
Version: 11.0

Authentication and Access APIs

POST /oauth/token

Description

Access to Insights APIs is regulated via an API key/token. It is used for authentication purposes in the user's automation code implementation. Once the API key is generated, it remains valid and can be used multiple times.

Authentication API is the mechanism that generates an API key/token for further authentication based on the provided username and password.

Body Parameters

NameDescriptionTypeRequiredDefault
grant_typeThe type of the input parametersStringYespassword
usernameLogin account nameStringYes
passwordLogin account passwordStringYes
client_idThe client ID for authenticationStringYesfixstreamapp
client_secretThe client secret for authenticationStringYesfixstream
scopeThe access scope of the tokenStringNoread write trust

CURL Example

The below code snippet shows an example of the API call, where <NCE-IP>, <PASSWORD> & <USERNAME> are variables.

curl --location 'https://<NCE-IP>/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'password=<PASSWORD>' \
--data-urlencode 'username=<USERNAME>@resolve.io' \
--data-urlencode 'client_id=fixstreamapp' \
--data-urlencode 'client_secret=fixstream' \
--data-urlencode 'scope=read write trust'

Response

Upon a successful request, the API returns Status code 200 with the following body:

NameDescriptionType
access_tokenThe API token needed for further authenticationString
token_typeThe token type. By default, it's "bearer"String
refresh_tokenThe API token needed for authentication refreshString
expires_inNumber of seconds to expire the token. After that use the refresh tokenInteger
scopeAccess scope of the token. By default, it's "read, write, trust"String
userDetails about the authenticated userObject
jtiUnique identifier for the generated API key/tokenString

GET /api/v2/users/loggedIn/detail

Description

Get details of the authorized user including name, last login time, organizations, and sites with their corresponding access privileges.

Header Parameters

TypeDescriptionTypeRequiredDefault
AuthorizationBearer API token/key. The format is Bearer <API_key>StringYes

CURL Example

The below code snippet shows an example of the API call, where <NCE-IP> & <API-TOKEN> are variables.

curl --location 'https://<NCE-IP>/api/v2/users/loggedIn/detail' \
--header 'Authorization: Bearer <API-TOKEN>'

Response

Upon a successful request, the API returns Status code 200 with the following body:

NameDescriptionType
nameUser's display nameString
firstNameUser's first nameString
lastNameUser's last nameString
middleNameUser's middle nameString
emailUser's email addressString
emailAddressString
phoneUser's phoneString
passwordNot in use. User's password hashString
createdByUsername that created this userString
lastUpdatedByUsername that updated this userString
userTypeUser's typeString
authenticationTypeAuthentication typeString
defaultOrgUser's default organization. The format is defaultOrgId:OrgNameString
defaultSiteUser's default site. The format is "defaultOrgId:OrgName":"SiteId:SiteName"List
lastUserUpdateTimeLast time when the record was updated. The format is timeyyyy-MM-ddThh:mm:ss.tttZSting
lastLoginTimeLast time when the user was logged in. The format is timeyyyy-MM-ddThh:mm:ss.tttZSting
groupUser's access groupString
orgPrivilegeMapAccess schema for the assigned group. It contains a list of organizations, sites, roles, and privileges per each setObject