Public
Documentation Settings

Arnika - Crm Exchange REST API V2

AUTHORIZATIONBearer Token

POSTUser Auth

/api/v2/auth

Метод авторизации клиента, возвращает данные клиента и его токен

Bodyraw (json)
json
{
    "email":"gnrgargbjmrgrg@mail.ru",
    "password":"2020arn"
}
Example Request
curl
curl --location '/api/v1/auth' \
--data-raw '{
    "email":"example@email.ru",
    "password":"password"
}'
200 OK
Example Response
json
{
  "status": "success",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTE5NzMyLCJvcmdJZCI6NjA1MTksIm5hbWUiOiLQmNC70L7QvSDQnNCw0YHQuiDQnNC7IiwicGhvbmUiOiIrNyg5MjIpNTA4LTI4LTcwIiwiZW1haWwiOiJ0ZXRlcmluLXN0ZXBhbnRldGVyaW5AeWFuZGV4LnJ1IiwiaWF0IjoxNjYxNDEzOTM5fQ.faByK9vGnvT4d61npvR6NQ5sGgKyiI9yNvjsU5AtUIM",
  "user": {
    "id": 119732,
    "orgId": 60519,
    "name": "Илон Маск Мл",
    "phone": "+7(922)508-28-70",
    "email": "teterin-stepanteterin@yandex.ru"
  }
}
No response headers
This request doesn't return any response headers

POSTEdit Hook Settings

/api/v2/hook_settings

Настройка веб-хуков для организации, необходимо передать массив url хуков, массив каждый раз переписывается, если передать пустой - обнулится.

HEADERS
Authorization

Bearer

Bodyraw (json)
json
{
    "urls":[
        "https://eozi2qpczsut8qj.m.pipedream.net"
    ]
}
Example Request
curl
curl --location '/api/v2/hook_settings' \
--header 'Authorization: Bearer ' \
--data '{
    "urls":[
        "https://eozi2qpczsut8qj.m.pipedream.net"
    ]
}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

GETGet Visits

/api/v2/visit?dateFrom=2023-04-26&dateTill=2023-11-30

Получение списка визитов за определенные даты, параметры обязательны, без параметров возвращает за текущее число.

AUTHORIZATIONBearer Token
This request is using Bearer Token from collectionArnika - Crm Exchange REST API V2
HEADERS
Authorization

Bearer

PARAMS
dateFrom

2023-04-26

dateTill

2023-11-30

page

Не обязательно

perPage

Не обязательно

Example Request
curl
curl --location '/api/v2/visit?dateFrom=2023-04-26&dateTill=2023-11-30' \
--header 'Authorization: Bearer '
200 OK
Example Response
json
{
  "data": [
    {
      "id": 9,
      "resourceId": 2,
      "services": [
        {
          "id": 3,
          "name": "00\\а Ремонт",
          "paySum": 500,
          "price": "500.00",
          "discount": 0,
          "amount": 1
        }
      ],
      "commodities": [],
      "subscriptions": [],
      "certificates": [],
      "totalPrice": "500.00",
      "totalCost": "500.00",
      "client": 1,
      "clientData": {
        "id": 1,
        "name": "Физическое лицо",
        "firstname": "",
        "lastname": "Физическое лицо",
        "patronymic": "",
        "phone": "",
        "additionalPhone": "",
        "sex": 0,
        "birthDate": null,
        "comment": "",
        "totalArrival": "500.00",
        "type": null,
        "visitsCount": 1,
        "tags": [],
        "email": "",
        "passportData": null
      },
      "datetime": "2023-11-07 14:00:00",
      "comment": "",
      "master_requested": true,
      "attendance": 1,
      "deleted": false,
      "online": false,
      "author": "Ятут Главный",
      "organization": {
        "name": "АПИпипипи",
        "id": 61542
      },
      "create_date": "2023-11-07 14:37:30",
      "update_date": "2023-11-07 14:37:30"
    },
    {
      "id": 10,
      "resourceId": 1,
      "services": [
        {
          "id": 1,
          "name": "Стрижка мужская",
          "paySum": 500,
          "price": "500.00",
          "discount": 0,
          "amount": 1
        }
      ],
      "commodities": [],
      "subscriptions": [],
      "certificates": [],
      "totalPrice": "500.00",
      "totalCost": "500.00",
      "client": 2,
      "clientData": {
        "id": 2,
        "name": "Манилов Георгий Георгиевич",
        "firstname": "Георгий",
        "lastname": "Манилов",
        "patronymic": "Георгиевич",
        "phone": "+7(777)777-77-77",
        "additionalPhone": "",
        "sex": 1,
        "birthDate": "03.11.1986",
        "comment": "абвгдйка",
        "totalArrival": "0.00",
        "type": null,
        "visitsCount": 0,
        "tags": [],
        "email": "77777@77.com",
        "passportData": "66 55 444321"
      },
      "datetime": "2023-11-07 15:30:00",
      "comment": "Создано Амо",
      "master_requested": true,
      "attendance": 0,
      "deleted": false,
      "online": true,
      "author": "Онлайн-запись",
      "organization": {
        "name": "АПИпипипи",
        "id": 61542
      },
      "create_date": "2023-11-07 14:40:41",
      "update_date": "2023-11-07 14:40:41"
    }
  ],
  "meta": {
    "page": 1,
    "lastPage": 1,
    "maxPerPage": 20
  }
}
Server

nginx

Date

Tue, 07 Nov 2023 11:09:48 GMT

Content-Type

application/json; charset=utf-8

Transfer-Encoding

chunked

Connection

keep-alive

Content-Security-Policy

default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests

Cross-Origin-Embedder-Policy

require-corp

Cross-Origin-Opener-Policy

same-origin

Cross-Origin-Resource-Policy

same-origin

X-DNS-Prefetch-Control

off

Expect-CT

max-age=0

X-Frame-Options

SAMEORIGIN

Strict-Transport-Security

max-age=15552000; includeSubDomains

X-Download-Options

noopen

X-Content-Type-Options

nosniff

Origin-Agent-Cluster

?1

X-Permitted-Cross-Domain-Policies

none

Referrer-Policy

no-referrer

X-XSS-Protection

0

ETag

W/"71a-72yUDHNnqculZ6bjKqHGjuO6I0k"

Vary

Accept-Encoding

Content-Encoding

gzip

GETGet Visit

/api/v2/visit/1324

Получение информации по конкретному визиту

HEADERS
Authorization

Bearer

Example Request
curl
curl --location '/api/v2/visit/1077' \
--header 'Authorization: Bearer '
Example Response
json
{
  "status": "success",
  "visit": {
    "id": 1324,
    "resourceId": 1,
    "services": [
      {
        "id": 2,
        "name": "Маникюр",
        "paySum": 500,
        "price": "500.00",
        "discount": 0,
        "amount": 1
      }
    ],
    "commodities": [],
    "subscriptions": [],
    "certificates": [],
    "totalPrice": "500.00",
    "totalCost": "500.00",
    "client": 1,
    "clientData": {
      "id": 1,
      "name": "Физическое лицо",
      "firstname": "",
      "lastname": "Физическое лицо",
      "patronymic": "",
      "phone": "",
      "sex": 0,
      "birthDate": null,
      "comment": "",
      "totalArrival": "500.00",
      "type": "potential",
      "visitsCount": 1,
      "tags": [
        "Источник: реклама в Instagram",
        "Источник: отзывы на Flamp"
      ],
      "email": "test@example.com"
    },
    "datetime": "2023-04-26 12:00:00",
    "comment": "",
    "master_requested": true,
    "attendance": 1,
    "deleted": false,
    "online": false,
    "author": "Вагин Дмитрий",
    "organization": {
      "name": "Тестовый",
      "id": 48542
    },
    "create_date": "2023-04-26 12:21:17",
    "update_date": "2023-04-26 12:29:19"
  }
}
No response headers
This request doesn't return any response headers