Data API
Authorization types:
- id_token - The ID token is a JSON web token (JWT) that contains claims about the identity of the authenticated user;
Dictionary
Receive All Data Types
URL
GET <api_url>/api/v2/data/types
Headers
Content-Type: application/json
Body
{}
Response 200: OK
[
{
"id": <int>,
"type": <string>,
"name": <string>,
"pattern": <string>,
"is_unique": <bool>,
"is_validated": <bool>
}
]
Receive Data Types For Application
URL
GET <api_url>/api/v2/data/types?application_id={{fan_application_sub}}
Query Paramiters
application_id: The unique application identity;
Headers
Content-Type: application/json
Body
{}
Response 200: OK
[
{
"id": <integer>,
"type": <string>,
"name": <string>,
"pattern": <string>,
"is_unique": <bool>,
"is_validated": <bool>
"application_config": {
"application_id": <integer>,
"is_required": <bool>
}
}
]
User data
Receive User Data
URL
GET <api_url>/api/v2/data/user
Headers
Content-Type: application/json
Authorization: <id_token>
Body
{}
Response 200: OK
{
"property1": "<string>",
"property2": "<string>"
}
Update User Data
URL
PATCH <api_url>/api/v2/data/user
Headers
Content-Type: application/json
Authorization: <id_token>
Body
{
"property1": "<string>",
"property2": "<string>"
}
Response 200: OK Description: All actual user details are returned;
{
"property1": "<string>",
"property2": "<string>"
}
Response 422: Data update errors; Description: List of errors that occurred during the data update;
{
"status": 422,
"type": "data-001",
"details": "Data update errors.",
"errors": [
{
"status": 422,
"type": "data-002",
"details": "The '<property>' data name not found.",
"error": "NOT_FOUND",
"field": "<property>"
},
{
"status": 409,
"type": "data-003",
"details": "The '<property>' is unique.",
"error": "ALREADY_EXISTS",
"field": "<property>"
},
{
"status": 422,
"type": "data-004",
"details": "The '<value>' is not valid.",
"error": "VALIDATION_ERROR",
"field": "<property>"
},
{
"status": 422,
"type": "data-005",
"details": "Invalid regular expression.",
"error": "PATTERN_VALIDATION_ERROR",
"field": "<property>"
}
]
}