Tokens

To get a token, perform the following steps:

  1. Ensure that you have a valid set of credentials (user name and password). Contact Aurea Support if you need an account.
  2. Go to POST /sessions endpoint for reference.
  3. Enter the following as the value for the request:

{ \

"password": "<your_password_here>", \

"username": "<your_username_here>" \

}

  1. Click Try it out! button to obtain the token. If your credentials are correct, under the Response Body section, you should get an object containing sessionId, token and your current organization details as shown in the following:

{

"sessionId": "62d02c3e-548a-11e8-96cb-c52712803b4b",

"token": "8b385c3c-38ec-4c26-9827-067a4fcd97c3",

"userName": "lhquser9@ligflat.com",

"firstName": "LHQ",

"lastName": "User 9",

"email": "lhquser9@ligflat.com",

"locked": false,

"resetPassword": false,

"firstTimeLogin": false,

"org": {

"name": "Zanza's EL6 Testing",

"lhqOrgUid": "f4fcdc86-ba2e-4ce0-81f0-cf1d5f2dd26d",

"deleted": false,

"lhqWorkGroupId": 10311,

"siteId": 12347260,

"farmUrl": "https://www.elabs6.com"

},

"roleName": "user",

"lhqOrganizations": [

{

"name": "Sales2",

"uid": "08781919-4dce-4e21-a6ae-19351b45aba5",

"isAdmin": true,

"workGroupId": 4155

},

{

"name": "Zanza's EL14 Testing",

"uid": "5bc0bb7e-320d-450e-8a3c-89bfa6b4bc70",

"isAdmin": false,

"workGroupId": 12088

},

{

"name": "Zanza's EL3 Testing",

"uid": "015c5c5c-f76c-4811-a062-0e53266fd619",

"isAdmin": false,

"workGroupId": 10309

},

{

"name": "Zanza's EL6 Testing",

"uid": "f4fcdc86-ba2e-4ce0-81f0-cf1d5f2dd26d",

"isAdmin": false,

"workGroupId": 10311

},

{

"name": "Aurea CRM Dev",

"uid": "b23c6eb0-d995-4b73-8ac9-371eb38c046e",

"isAdmin": false,

"workGroupId": 14225

},

{

"name": "top5flicks",

"uid": "7f83710f-de00-4e02-b35e-1e2a42287ab0",

"isAdmin": false,

"workGroupId": 6134

}

],

"lhqUserId": 31294

}

NOTE

The lhqOrganizations is an array of all organizations you can access with your credentials. You can submit any request using those organizations' UID (OrgUID) until you switch the organization by passing the token in X-LHQ-TOKEN header to GET /sessions/switch/{orgUid} endpoint.

curl -X GET --header 'Accept: application/json' \

--header 'X-LHQ-TOKEN: 8b385c3c-38ec-4c26-9827-067a4fcd97c3' \ 'https://api.cam.aurea.com/sessions/switch/015c5c5c-f76c-4811-a062-0e53266fd619'

You will get a new token to the requested organization on switch action.

{

"sessionId": "string",

"token": "string",

"userSession": {

}

}