Skip to content

Authentication

Most API endpoints are for administrator level functionalities. A valid username and password is needed to generate a session token, which is required as part of the request header for most of the API calls.

Login

POST /login Use the login endpoint to generates an authentication token for a session. If the user does not exist, or if the password is incorrect, then it will return an error.

Required parameters are the username user and password pass.

Request Example:

bash
curl --location 'https://localhost:3001/nxapi/v1/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'r=createsession' \
--data-urlencode 'user={{username}}' \
--data-urlencode 'pass={{password}}'

Check the Session

GET /checksession This endpoint pings the system to check if the session is still valid.

Request Example:

bash
curl --location '{{url}}/checksession' \
--header 'token;'

Logout

GET /logout The logout endpoint invalidates a session by the request header's token.

Request Example:

bash
curl --location '{{url}}/logout' \
--header 'token;'

External Authentication

GET /externalauth This endpoint retrieves the external authentication settings.

Request Example:

bash
curl --location '{{url}}/externalauth' \
--header 'token;' \
--data ''
PUT /externalauth This endpoint updates the external authentication setting.

Required parameters are domainName and externalAuthenticationEnabled.

Request Example:

bash
curl --location --request PUT '{{url}}/externalauth' \
--header 'token;' \
--header 'Content-Type: application/json' \
--data '{
    "domainName": "{{domain name}}",
    "externalAuthenticationEnabled": true,
    "server0": "{{server_ip}}",
    "port0": "{{server_port}}",
    "enabled0": true
}'