...
Content
Table of Contents |
---|
Setup
This is the documentation of how to obtain an authentication token for the ws.di.no domain.
...
In order to POST data into the API use a JSON object without name.
You should also set the Content-Type header to "application/json".
A request will look like this:
Curl request
Info |
---|
|
Environments / endpoints
TEST |
| https://staging-ws.di.no/ws/json/auth/v-2/login | ||||||
PRODUCTION |
| https://ws.di.no/ws/json/auth/v-2/login |
Making a request
Request headers
Key | Value |
---|---|
Content-Type | application/json |
Request body
Field | Description | Example | Data type |
---|---|---|---|
username | The username that was provided by the DI service desk | myName | String |
password | The password that was provided by the DI service desk | secret!23 | String |
Curl request example
Code Block |
---|
curl https://ws.di.no/ws/json/auth/v-2/login \ -H "Content-Type:application/json" \ -d "{\"username\": \"myname\", \ \"password\": \"secret\" }" |
Request object:
...
Field
...
Description
...
Example
...
Data type
...
Count
...
Response
...
The endpoint replies with a response object in JSON format, containing the following data
Field | Description | Example | Data type |
---|
Count
token | The JWT token to be used in subsequent requests | aVeryLongString | String |
The security token should be placed in the Authorization header like this:
"Authorization: Bearer <token>"
The token is valid for 30 minutes and is a json web token ( https://jwt.io/ ) but can be handled as a plain string on the client side.
Changelog:
...