NSN API Documentation (v1.0)

The API is available at https://api.nsn.org.uk/v1/

Documentation homepage https://docs.api.nsn.org.uk/


CURL example

The example below shows you how to authenticate against the API using CURL, and hit the /areas endpoint.

If you have an username and password, enter them here to populate the examples:

POST /v1/jwt

To authenticate against the API you must first POST your username and password in a JSON object in the body of your request to the /jwt endpoint to retrieve your JWT IdToken.

curl 
  --location 
  --request POST 'https://api.nsn.org.uk/v1/jwt' \
  --header 'Content-Type: text/plain' \
  --data-raw '{
    "username": "{username}",
    "password": "{password}"
}'

GET /v1/jwt/areas

Extract the IdToken from the JSON response and include it as an Authorization token within the header of all subsequent requests

curl 
    --location 
    --request GET 'https://api.nsn.org.uk/v1/jwt/areas' \
    --header 'Authorization: Bearer {IdToken}'

PUT /v1/jwt/

The initial token also returns a RefreshToken which you may use to refresh your IdToken for 30 days. To refresh a token, PUT a request with your token in a JSON object in the body of your request to retrieve a new IdToken.

curl 
    --location 
    --request PUT 'https://api.nsn.org.uk/v1/jwt' \
    --header 'Content-Type: text/plain' \
    --data-raw '{
        "token": "{refreshToken}"
}'

Documentation homepage https://docs.api.nsn.org.uk/