Getting template

Method: POST

Url: https://test.ninjalender.online/template/get

Headers:

header_key

content

Content-Type:

application/json;

Authorization

Bearer {{Token}}

Ninja-Lang

locale to witch we will translate titles (pl_PL, en_GB)

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) 6 - phone in international format 7 - valid email address

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

Variants array example (from requisite)

Key

Type

Description

label

string

variant label

title

string

variants translated title

Request example:

{
    "params":{
        "id": 20
    }
}

Response example:

Success:

{
    "code": 0,
    "message": "ok",
    "data": {
        "body": {
            "one": {
                "id": "4",
                "kind": 2,
                "label": "one",
                "required": false,
                "variants": null,
                "description": null,
                "title": "one"
            },
            "two": {
                "id": "5",
                "kind": 5,
                "label": "two",
                "required": false,
                "variants": [
                    {
                        "label": "one",
                        "title": "One"
                    },
                    {
                        "label": "tow",
                        "title": "Two"
                    }
                ],
                "description": null,
                "title": "two"
            },
           
        },
        "id": 20,
        "label": "NOT_1-8test",
        "description": null,
        "title": "NOT_1-8test"
    },
    "log_key": 731
}

Error:

{
    "code": -1,
    "message": "error",
    "log_key": 749,
    "errors": [
        {
            "code": -1020201,
            "message": "Params is required"
        }
    ]
}

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 updated