This URL allows a third party application to log in to NSM API framework.
Resource URL
GET /session
Request Parameters
NSM REST SDK user needs to authenticate with the Manager first by calling the 'Session' resource URL. The 'Session' resource takes the user name and password in a base64 encoded string through the custom header, NSM-SDK-API.
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| userName | Login user name - Minimum of 8 characters | String | Yes |
| password | Login user password | String | Yes |
Response Parameters
On successful authentication, the 'Session' resource URL returns the user id and session in the response body.
Every other resource URLs in the SDK is required to pass credentials for validation and authorization in the custom header NSM-SDK-API. The credentials are user id and session id return from the 'Session' resource URL. They are also passed in base64 encoded format.
| Field Name | Description | Data Type |
|---|---|---|
| session | Logged in session id | String |
| userId | Logged in user id | Number |
Note
The default SDK API session inactivity timeout is 24 hours
Example
Request
GET https://%3CNSM_IP%3E/sdkapi/session
Response
{
"session": "4B63900C0C913E8944EAC68CABF12ACF",
"userId": "1"
}
Error Information
Following error codes are returned by this URL:
| S.No | HTTP Error code | SDK API errorId | errorMessage |
|---|---|---|---|
| 1 | 401 | Invalid credentials | |
| 2 | 415 | Invalid accept header | |
| 3 | 415 | Invalid content type header |