The API is available at https://api.nsn.org.uk/v1/
The JWT API is available at https://api.nsn.org.uk/v1/jwt/
The NSN API allows you to integrate with the NSN database of resources to find support services to help your users
Organisations that provide support are called Resources. Resources are in one or more Topic Categories. Categories have one parent and may have one, none or many child categories. Categories fit within one of the top topic Areas.
The API is versioned with a value in the URL (For example: https://api.nsn.org.uk/v1/areas). If you omit the version (For example: https://api.nsn.org.uk/areas) it will respond with the latest version. New versions are created when there are breaking changes added. New field parameters may be added to an existing version, as long as the API remains backwards compatible.
There are two ways of authenticating against the API. Either using an API key or by using a JWT. Using an API key is simpler, but can only be done on the backend. Using a JWT is a small amount more work, but allows you to generate a key that can be given to the front end to use.
You authenticate against the API by including an API key header in the request as x-api-key
. Keep this key secure and do not use it in the front end.
Code snippets and samples for you to get started with API Key authentication and API usage.
If you want to make the requests directly to the API from the front end, you can authentiate using JWT. To do this you should POST to the /v1/jwt
endpoint from your backend so as not to reveal your credentials to the public. Include your username and password as a JSON object in the body:
{
'username': username,
'password': password
}
You will receive a JWT IdToken
to send to your front end to be used. The token lasts for 1 hour.
As part of the payload you will also receive a RefreshToken
that expires after 30 days. To refresh your token you PUT to the /v1/jwt
endpoint. Include your token as a json object in the body:
{
'token': RefreshToken
}
Refreshing is optional. You may find it easier to simpler re-authenticate rather than refreshing your token.
Code snippets and samples for you to get started with JWT authentication and API usage.
Lists all possible endpoints and provides links to support resources. This is available withotu authentication.
Dictionary of possible return values for enumerated keys. (For example, lists all the possible return values for support type and location). This is available withotu authentication.
Returns a list of the top level areas.
Returns a list of all categories
Returns details about a particular category.
Returns details about a particular resource.
Returns resource results for a search term.
Returns category results for a search term.
Returns a basic array of category suggestions for a search term.
Returns a basic array of resource suggestions for a search term.
Login with your credentials to get a new JWT.
Refresh your JWT.
Returns a list of the top level areas.
Returns a list of all categories
Returns details about a particular category.
Returns details about a particular resource.
Returns resource results for a search term.
Returns category results for a search term.
Returns a basic array of category suggestions for a search term.
Returns a basic array of resource suggestions for a search term.