Download OpenAPI specification:Download
Introduction
This document covers the public available PufinID APIs. The PufinID API is built on HTTP. It returns HTTP response codes to indicate errors. It accepts and return JSON in the http body.
Many API endpoints require authentication.
You authenticate your request by sending a token in the Authorization
header.
The API supports JWT tokens and you must use authorization: Bearer
.
If you try to use an endpoint without a token or with a token that has insufficient
permission you will receive a 404 Not Found
or 403 Forbidden
response.
Here is is an example of how tokens are used:
curl -L \
-H "Autherization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
https://api.pufinid.com/v1/users/me
Note: The token is currently a JWT token but that might change in the future.
Because of this do not rely on the information that is encoded in the JWT
since it might break in the future. For how to get user information consult the User
section.
Obtain a token by authenticate a user based on username and password.
The returned access
token must be sent as part of a request for all endpoints that require authentication.
The returned refresh
token is used to refresh the access
token. The lifetime of each token is dynamic and is returned
as part of the response.
username required | string username |
password required | string password |
{- "username": "string",
- "password": "string"
}
{- "access": "string",
- "refresh": "string",
- "access_expires_in": 300,
- "refresh_expires_in": 86400
}
Obtain a new access token based on a refresh token. When short-lived access token expires, the longer-lived refresh token can be used to obtain another access token. This will also set a new expiration time for the access token.
The expiration time for the refresh token stays the same.
refresh required | string The |
{- "refresh": "string"
}
{- "access": "string",
- "access_expires_in": 0
}
Revokes a refresh token. Refresh token is invalidated and cannot be used anymore to create new access tokens.
Note this does not invalidate any of the access tokens that were created together with or with the refresh
token.
refresh required | string Refresh token to be revoked |
{- "refresh": "string"
}
{- "detail": "string",
- "refresh": [
- "string"
]
}
Verify that a token is valid. This can be used both to verify an access token and a refresh token.
token required | string Token to verify |
{- "token": "string"
}
{- "detail": "string",
- "token": [
- "string"
]
}
Get Apps Profile by client id
g | string group id |
id | string unique id of the qr code |
o required | string client id |
Apps profile response
{- "config": {
- "puf_design": {
- "auto_capture_enabled": true,
- "description": "",
- "id": "9c48c1bc-e979-4b2c-ab06-9d81e2342b2e",
- "name": "PufSales1",
- "organization": "fca94a52-1934-4d9f-ad6a-dd3c471d5f6f",
- "puf_design_type": "QR"
}, - "token": "eyJhb...8",
- "expires_in": 85937
}, - "actions": {
- "validation": {
- "description": "Perform a search",
- "form": {
- "file": {
- "type": "file",
- "required": true,
- "description": "Image file to be validated"
}, - "puf_design_id": {
- "value": "uuid string",
- "type": "const",
- "required": true,
- "description": "PUF Design ID"
}, - "state": {
- "value": "active",
- "type": "const",
- "required": false,
- "description": "Puf State to validate"
}
}, - "headers": {
- "Authorization": "Bearer eyJhb...8"
}, - "method": "POST",
- "name": "validation",
- "url": "validations/search"
}
}
}
List all FAQ topics.
limit | integer Number of results to return per page. |
offset | integer The initial index from which to return the results. |
{- "count": 123,
- "results": [
- {
- "id": 0,
- "name": "string",
- "sort_order": -2147483648,
- "questions": [
- {
- "text": "string",
- "answer": "string",
- "topic": 0,
- "sort_order": -2147483648
}
]
}
]
}
Get a specific topic by id.
id required | integer A unique integer value identifying this Topic. |
{- "id": 0,
- "name": "string",
- "sort_order": -2147483648,
- "questions": [
- {
- "text": "string",
- "answer": "string",
- "topic": 0,
- "sort_order": -2147483648
}
]
}
API endpoint that allows PufDesign to be viewed or edited.
limit | integer Number of results to return per page. |
offset | integer The initial index from which to return the results. |
{- "count": 123,
- "results": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "description": "string",
- "puf_design_type": "string",
- "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
- "puf_design_icon_url": "string",
- "auto_capture_enabled": true
}
]
}
API endpoint that allows PufDesign to be viewed or edited.
id required | string <uuid> A UUID string identifying this puf design. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "description": "string",
- "puf_design_type": "string",
- "organization": "452c1a86-a0af-475b-b03f-724878b0f387",
- "puf_design_icon_url": "string",
- "auto_capture_enabled": true
}
List all terms a user has to accept before signing up.
If this endpoint is called for an authenticated user, it will list all terms that the user has not accepted yet.
with the query parameter include_all
set to true
,
it will also include terms that has been accepted and when.
[- {
- "name": "string",
- "slug": "string",
- "version_number": 0,
- "text": "string",
- "info": "string",
- "date_active": "2019-08-24T14:15:22Z"
}
]
Get a specific term by slug.
Current terms to sign by user creation:
/v1/terms/privacy
slug required | string |
{- "name": "string",
- "slug": "string",
- "version_number": 0,
- "text": "string",
- "info": "string",
- "date_active": "2019-08-24T14:15:22Z"
}
API endpoint that allows users to be viewed or edited.
first_name required | string [ 2 .. 100 ] characters |
last_name required | string [ 2 .. 100 ] characters |
username | string or null [ 2 .. 100 ] characters |
email required | string <email> |
password required | string [ 8 .. 100 ] characters |
password_confirm required | string [ 8 .. 100 ] characters |
terms_accepted | Array of strings[ items <= 255 characters ] A list of all terms a user has accepted upon registration. all values must be For accepting all terms use the special value |
phone | string or null <= 20 characters |
postcode | string or null <= 20 characters |
country | string or null <= 20 characters |
gender | string or null <= 20 characters |
age | string or null <= 20 characters |
organization_code | string or null <= 20 characters Signup for a specific environment. If If If |
{- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "email": "user@example.com",
- "password": "stringst",
- "password_confirm": "stringst",
- "terms_accepted": [
- "string"
], - "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string",
- "organization_code": "string"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "email": "user@example.com",
- "terms_not_accepted": [
- "string"
], - "is_verified": true,
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string",
- "organization_name": "string",
- "theme": {
- "property1": null,
- "property2": null
}
}
Get user details. To get user details for the authenticated user you can use me
as the {id}
.
id required | string <uuid> A UUID string identifying this user. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "email": "user@example.com",
- "terms_not_accepted": [
- "string"
], - "is_verified": true,
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string",
- "organization_name": "string",
- "theme": {
- "property1": null,
- "property2": null
}
}
Update user details. To update user details for the authenticated user you can use me
as the {id}
.
id required | string <uuid> A UUID string identifying this user. |
first_name required | string or null [ 2 .. 100 ] characters |
last_name required | string or null [ 2 .. 100 ] characters |
phone required | string or null <= 20 characters |
postcode required | string or null <= 20 characters |
country required | string or null <= 20 characters |
gender required | string or null <= 20 characters |
age required | string or null <= 20 characters |
{- "first_name": "string",
- "last_name": "string",
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "email": "user@example.com",
- "terms_not_accepted": [
- "string"
], - "is_verified": true,
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string",
- "organization_name": "string",
- "theme": {
- "property1": null,
- "property2": null
}
}
Partial update user details. To partial update user details for the authenticated user you can use me
as the {id}
.
id required | string <uuid> A UUID string identifying this user. |
first_name | string [ 2 .. 100 ] characters |
last_name | string [ 2 .. 100 ] characters |
phone | string <= 20 characters |
postcode | string <= 20 characters |
country | string <= 20 characters |
gender | string <= 20 characters |
age | string <= 20 characters |
{- "first_name": "string",
- "last_name": "string",
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "first_name": "string",
- "last_name": "string",
- "username": "string",
- "email": "user@example.com",
- "terms_not_accepted": [
- "string"
], - "is_verified": true,
- "phone": "string",
- "postcode": "string",
- "country": "string",
- "gender": "string",
- "age": "string",
- "organization_name": "string",
- "theme": {
- "property1": null,
- "property2": null
}
}
Delete user. To update user details for the authenticated user you can use me
as the {id}
.
id required | string <uuid> A UUID string identifying this user. |
{- "non_field_errors": [
- "string"
], - "password": [
- "string"
]
}
Confirm user email.
email required | string <email> |
token required | string >= 20 characters |
{- "email": "user@example.com",
- "token": "stringstringstringst"
}
{- "non_field_errors": [
- "string"
], - "email": [
- "string"
], - "token": [
- "string"
]
}
Resend confirm email. This requires an email whether user is logged in or not.
email required | string <email> |
{- "email": "user@example.com"
}
{- "non_field_errors": [
- "string"
], - "email": [
- "string"
]
}
Send email to user with email
with reset password link.
This link will contain a token that will expire within X (TBD).
email required | string Email that will receive a reset password link. |
{- "email": "string"
}
{- "detail": "string",
- "email": [
- "string"
]
}
Update password for the authenticated user.
old_password required | string |
new_password required | string >= 8 characters |
new_password_confirm required | string |
{- "old_password": "string",
- "new_password": "stringst",
- "new_password_confirm": "string"
}
Resets a users password.
This endpoint is the last step of the reset password flow.
When a user has requested a password reset,
he will receive an email with a link that contains
email
and token
as query parameters (See "Send reset password email" for how to trigger the email).
When clicking this link he will be directed to a place where he can enter a new password.
The typed password must be submitted to this endpoint along with
the emailand
token` query paramters.
email required | string <email> The email received in the reset link. |
new_password required | string >= 8 characters The new password to be set. |
new_password_confirm required | string Confirming the new password to be set |
token required | string The token received in the reset link. |
{- "email": "user@example.com",
- "new_password": "stringst",
- "new_password_confirm": "string",
- "token": "string"
}
{- "detail": "string",
- "email": [
- "string"
], - "new_password": [
- "string"
], - "new_password_confirm": [
- "string"
], - "token": [
- "string"
]
}