Getting template
Method: POST
Url: https://test.ninjalender.online/template/get
Headers:
header_key
content
Content-Type:
application/json;
Authorization
Bearer {{Token}}
Where {{Token}} - token obtained during authorization
Request body:
Key
Type
Required
Description
params
JSON.object
+
Request parameters (in this case, an empty object)
Params:
Key
Type
Required
Description
id
int
+
Id of template
Response:
Key
Type
Description
code
int
Response code
message
string
Response message
data
JSON.object
Response data
data:
Key
Type
Description
id
int
Id of template
label
string
name of template
description
string
description of template
title
string
title of template
body
json.object
list of requisites in template where the key is the name of requisite, and in the values - description of requisite
Requisite example from body
Key
Type
Description
id
int
id of requisite
kind
int
Kind of requisite, defines data type for requisite value:
0 – string
1 – text
2 – number
3 – date
4 – boolean
5 – handbook(in the case of this kind, the system will expect, as the value requisite, one of the elements from the variants array)
label
string
requisite name
required
boolean
is requisite required
variants
JSON.array
list of variants for handbook kind requisites
description
string
description of requisite
title
string
requisite title
Request example:
1
{
2
"params":{
3
"id": 20
4
}
5
}
6
Copied!
Response example:
Success:
1
[
2
{
3
"code": 0,
4
"message": "ok",
5
"data": {
6
"body": {
7
"one": {
8
"id": "4",
9
"kind": 2,
10
"label": "one",
11
"required": false,
12
"variants": null,
13
"description": null,
14
"title": "one"
15
},
16
"two": {
17
"id": "5",
18
"kind": 2,
19
"label": "two",
20
"required": false,
21
"variants": null,
22
"description": null,
23
"title": "two"
24
},
25
26
},
27
"id": 20,
28
"label": "NOT_1-8test",
29
"description": null,
30
"title": "NOT_1-8test"
31
},
32
"log_key": "731"
33
}
34
]
Copied!
Error:
1
[
2
{
3
"code": -1020201,
4
"message": "Params is required",
5
"log_key": "749"
6
}
7
]
Copied!
Error list:
Key
Message
-96
invalid key
-97
invalid token
-98
expired token
-99
system error
-100
access denied
-1020201
Params is required
-1020202
Id is blank
-1020203
Template not found
Last modified 1mo ago
Copy link