d-pac

Base URI

http://tool.d-pac.be/api
Parameters
email
string required

A valid, activated e-mail address

Example:
john.doe@example.com
password
string required
Example:
Foo15^
password_confirm
string required
Example:
Foo15^
Headers
Request-UUID
string optional
Applied to all methods

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses
401 Unauthorized

You are not authorized

Body
Methods: Signin
400 Bad Request

The server cannot or will not process the request due to something that is perceived to be a client error.

Body
Methods: Signin
Documentation
Test Chapter

Lorem ipsum

API Methods
Authentication
POST /user/session
GET /user/session
DELETE /user/session
Signin
POST /user/session

Creates a session, i.e. authenticates the user.

Request parameters

email
string required

A valid, activated e-mail address

Example:
john.doe@example.com
password
string required
Example:
Foo15^
password_confirm
string required
Example:
Foo15^

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
401 Unauthorized

You are not authorized

400 Bad Request

The server cannot or will not process the request due to something that is perceived to be a client error.

Examples

POST http://tool.d-pac.be/api/user/session?email=john.doe@example.com&password=Foo15^&password_confirm=Foo15^ HTTP/1.1 

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "53a984cca87b4b7d57a99858",
    "email": "john.doe@example.com",
    "name": {
        "first": "John",
        "last": "Doe"
    }
}
POST http://tool.d-pac.be/api/user/session HTTP/1.1 

Content-Type: application/json

{
    "email": "john.doe@example.com",
    "password": "Foo15^"
    "password_confirm": "Foo15^"
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "id": "53a984cca87b4b7d57a99858",
    "email": "john.doe@example.com",
    "name": {
        "first": "John",
        "last": "Doe"
    }
}
Status
GET /user/session

Retrieves the authentication status

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Signout
DELETE /user/session

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

204 No Content
Account

Access and modify account details

GET /users
GET /users/{id}
PATCH /users/{id}
List users
GET /users

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Array of UserModel
Retrieve user
GET /users/{id}

Path variables

id
string optional

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Update user
PATCH /users/{id}

Allows updating all account details of the logged in user

Path variables

id
string optional

Request parameters

email
string required

A valid, activated e-mail address

Example:
john.doe@example.com
password
string required
Example:
Foo15^
password_confirm
string required
Example:
Foo15^

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Retrieve authenticated user
GET /user

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Update authenticated user
PATCH /user

Allows updating all account details of the logged in user

Request parameters

email
string required

A valid, activated e-mail address

Example:
john.doe@example.com
password
string required
Example:
Foo15^
password_confirm
string required
Example:
Foo15^

Request headers

Request-UUID
string optional

Pass a unique id for each request for easier tracking of requests logs on the back-end

Responses

200 OK
Body
Data Reference
UserModel
Object
id
string
Example:
53a984cca87b4b7d57a99858
email
string
Example:
john.doe@example.com
name
Object
first
string
Example:
John
last
string
Example:
Doe
Error

HTTP Status Error

Object
code
number
Example:
422
status
number
Example:
422
name
string
Example:
Http422Error
message
string
Example:
Validation failed
explanation
Array of string
Example:
Passwords must match