Инструменты пользователя

Инструменты сайта


ru:airlay:dataloader

Это старая версия документа!


Серверная загрузка данных

API отправки

api type: POST
/api/v3/dataLoader/send
//headers//
Authorization: Bearer YOUR_TOKEN
Content-Type: application/x-www-form-urlencoded
//body//
body : string(данные для отправки)
dataSetId : string(id dataSet)
 
//return// возвращает id лога
Корректная отправка
{
    "status": 200,
    "message": "5d2*******d0c80",
    "code": 0
}
Токен не корректен
{
    "status": 400,
    "message": "Authorization error",
    "code": 0
}
Не отправлен токен авторизации
{
    "status": 403,
    "message": "Not logged in",
    "code": 0
}

Примеры данных по загрузке

Описание формата загрузки и выгрузки

API получения логов

Запрос логов осуществляется по ID, который был получен после отправки данных для загрузки. «userId»/«dataLoaderId» Указывается id либо пользователя если загрузка идёт напрямую пользователем, либо если загрузка идёт через dataLoader

id = logId
format = json
/api/v3/logs/get
{
    "time" : "2019-06-24T05:48:57.000Z",
    "userId"/"dataLoaderId" : "5c6bba434c4f0f18df7066ba",
    "status" : "success"/"error"/"In progress",
    "dataSetId" : "5d105c114c4f0f15e06049a3",
    "errorMessage" : "Parser error/another file error",
    "successCount" : int,
    "errorCount" : int,
    "objectErrorMessages" : Array<{
     "id" : string,
     "message" : string,
     "code" : int
    }>
}

Создание модуля загрузки

1. Блок «Модуль загрузки» отвечает за создание нового модуля с указанием имени `/api/dataLoader/create`.

2. Блок «Дополнительные конфигурации». Данный блок содержит настройки места отправки «Хранилище данных\DataSet» и «Тип отправляемых данных». Можно выбрать «Устройства\location», «Статичные\Static». Формат данных для «Static» Описание формата загрузки и выгрузки , формат данных для location формат location.

3. Блоке «Список токенов» содержит в себе список доступных для заданного DataLoader-а токенов. При необходимости можно запросить новый токен указав имя для него.

4. Блок «Способ отправки данных» содержит форму запроса к API.

Коды ошибок

Import data

  • 101 Invalid input data
  • 102 Invalid feature
  • 103 Object not delete. Unique field not set
  • 104 Object not delete. Object not found
  • 105 Coordinates must be is numeric

relation

  • 201 Relation properties not exists
  • 202 Relation members not exists
  • 203 Relation geometryType not exists

member

  • 301 'Member not found. Id
  • 302 'Node not found'
  • 303 Invalid member type
  • 304 One relation members expected for polygon
  • 305 Three or more node members expected for polygon
  • 306 Impossible to build the geometry of different types
  • 307 One relation member is expected for a point

geometry

  • 400 Invalid geometry
  • 401 Geometry type point is expected for a Point relation
  • 402 Geometry type Point or LineString is expected for a LineString
  • 403 Invalid geometry, is not array
  • 404 Invalid geometry, coordinates must contain one pair/triplet of coordinates
  • 405 Invalid geometry, incorrect longitude value
  • 405 Invalid geometry, incorrect latitude value
  • 406 Invalid geometry, the lineString must consist of 2 or more points
  • 407 Invalid geometry, duplicate points in line:
  • 408 Invalid geometry, the polygon must consist of 4 or more points
  • 409 Invalid geometry, the polygon is not closed
  • 410 Polygon crosses itself
  • 411 Invalid geometry type
  • 412 Invalid geometry coordinates
ru/airlay/dataloader.1563170345.txt.gz · Последнее изменение: 2019/07/15 12:59 — Рыков Павел