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

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


ru:airlay:api:air-lay-v2

Air Lay API v2


Раздел в процессе разработки

Структура запроса

    /**
    * api/v2/{controller}/{action}?{parameter1=value&parameter1=value&...}
    * Где
    * controller - контролер в котором производится действие,
    * action - действие контроллера,
    * parameter1, parameter2 ...  - параметры запроса,
    * value1, value2 ... - значение параметров
    */
post запрос
raw с json
 
{
    "version": 1,
    "kadNum": "24:11:0055:24:007",
    "inCity": true,
    "dCity": 300,
    "dOverCity": 500,
    "dMax": 100000,
    "maxAcc": 0.4,
    "centreArea": [
        92.36016614096505,
        55.957195305775436
    ],
    "objects": [
        {
            "dist": 45.5630759568201,
            "tplnr": "PS035-000403"
        },
        {
            "dist": 54.000446032760856,
            "tplnr": "PS035-000401"
        },
        {
            "dist": 62.82547067059525,
            "tplnr": "TP006-0001461"
        },
        {
            "dist": 66.31874139095346,
            "tplnr": "TP006-0001462"
        },
        {
            "dist": 68.20241607817265,
            "tplnr": "TP006-0001470"
        },
        {
            "dist": 71.39020177489581,
            "tplnr": "TP006-0001469"
        },
        {
            "dist": 75.6531728989073,
            "tplnr": "PS035-000402"
        },
        {
            "dist": 174.46758937820385,
            "tplnr": "TP006-0001467"
        },
        {
            "dist": 175.78817558695735,
            "tplnr": "PS035-000400"
        },
        {
            "dist": 176.235569705586,
            "tplnr": "TP006-0001468"
        },
        {
            "dist": 283.7276110218554,
            "tplnr": "PS110-000402"
        }
    ]
}

API

    /**
     * GET
     * Вход пользователя через name и password
     * @return JWT
     */
    /user/auth
 
    /**
     *GET
     * Регистрация пользователя необходимые параметры
     * string name 
     * string password 
     * string email в формате example@mail ~
     */
    /user/registration
 
    /**
     * GET
     * Action for get menu
     * @return object free trees and private trees
     */
    /user/getmenu
 
    /**
     * POST
     * Action for create tree. You can see JSON object descriptions below for more details.
     * @name string Name tree
     * @return object tree mongoDB object
     */
    /node/createtree
 
    /**
     * GET
     * Get layer objects by parameters.
     * @id layer id
     * Coordinates
     * @lat1
     * @lat2
     * @lon1
     * @lon1
     * @return object tree mongoDB object
     */
    /api/v2/node/getObjs
 
    /**
     * POST
     * Action get layer objects info
     * @collections json 
     *      {"collections" : [
     *          {
     *              "name" : "layersId",
     *              "layers" : [objectId, objectId, ...]
     *          },
     *          ...
     *      ]}
     * @return json
     */
    /api/v2/node/getObjsInfo
 
    /**
     * Action for create Node(layerEntity/dir). You can see JSON object descriptions below for more details.
     * @name string Node name
     * @type string type of the node. Values : layerEntity/dir
     * @treeId ObjectId the id of the tree in which the node is inserted
     * @parentId ObjectId parent of the node
     * @order order in the parent's childs. default -1
     * @return array ['node'=> nodeInfo]
     */
    /api/v2/node/createNode
 
    /**
     * Action for upload objects.
     * @layerId object Layer Id
     * @_FILES['json'] file with the geojson feature collection
     * @return string 200 Ok
     */
    /api/v2/uploadLayer
 
    /**
     * @param ObjectId $layerId Layer Id
     * @param string $format file format json/kml/dxf
     * @param string $filename file name
     * @return 200 Ok json/kml/dxf/gml file
     * @deprecated
     * Action for download layer objects.
     * Filter by coordinates. Bounds is bbox(2 points) or polygon(<2 points).
     * Example [[42.729949951171875, 43.23419794321918],
     *          [42.729949951171875,44.143783302207424 ],
     *          [44.20074462890625,44.143783302207424],
     *          [44.20074462890625,43.23419794321918]]
     * Filter by properties. Parameter name must be equal properties name.
     */
    /api/v3/node/downloadLayer
 
    /**
     * Action for changing node name.
     * @treeId string ObjectId
     * @nodeId string ObjectId
     * @name string node name
     * @return string 200 Ok
     */
    /api/v2/node/updateNodeName
 
    /**
     * Action for changing node parent or order.
     * @treeId string ObjectId
     * @nodeId string ObjectId
     * @newParentId string ObjectId
     * @order string order number of node in new parent
     * @return string 200 Ok
     */
    /api/v2/node/moveNode
 
    /**
     * Action for removing node.
     * @treeId object Layer Id
     * @nodeId object Layer Id
     * @return string 200 Ok
     */
    /api/v2/node/removeNode
 
    /**
     * Search tree by name
     * @name string tree name
     * @return 200 Ok json tree
     */
    /api/v2/node/searchTreeByName
 
    /**
     * Get srtm
     * @lat
     * @lon
     */
    /api/v2/user/srtm
 
    /**
     * Action  ensure layer db index.
     * @layerId
     * @indexName
     */
    /api/v2/node/ensureLayerIndex
 
    /**
     * Action  delete layer db index.
     * @layerId
     * @indexName
     */
    /api/v2/node/deleteIndex
 
    /**
     * GET
     * @id layer id
     * @return josn layer option
     */
    /api/v2/node/getLayerOptions
 
    /**
     * POST
     * @id layer id
     * @options json options
     * @return 200 Ok
     */
    /api/v2/node/updateLayerOptions
 
    /**
     * POST
     * Action for group creation
     * @name group name
     * @return json group
     */
    /api/v2/group/create
 
    /**
     * POST
     * Action update group name
     * @id ObjectId group id
     * @name string new group name
     * @return 200 Ok
     */
    /api/v2/group/updateName
 
    /**
     * Action adds a tree to the group.
     * @treeId ObjectId tree which to add
     * @groupId ObjectId group where to add
     * @return string 200 Ok
     */
    /api/v2/group/addTree
 
    /**
     * Action remove tree from group.
     * @treeId ObjectId tree which to remove
     * @groupId ObjectId group where to remove
     * @return string 200 Ok
     */
    /api/v2/group/removeTree
 
    /**
     * Action return user groups.
     * @return string 200 Ok
     */
    /api/v2/group/get
 
    /**
     * Action for adding user to group.
     * @userId string ObjectId.
     * @groupId string ObjectId.
     * @return string 200 Ok
     */
    /api/v2/group/addUser
 
    /**
     * Action set user/tree permissions for group
     * @id string ObjectId
     * @groupId string ObjectId
     * @permissions string group_mask
     * @entityName string 'trees'/'users'
     * @return string 200 Ok
     */
    /api/v2/group/setPermissions
 
    /**
     * Action for deleting user from group.
     * @userId string ObjectId.
     * @groupId string ObjectId.
     * @return string 200 Ok
     */
    /api/v2/group/deleteUser
 
    /**
     * POST
     * Action remove group
     * @id group id
     * @return 200 OK
     */
    /api/v2/group/remove
 
    /**
     * POST
     * Action for product creation.
     * @title string group name **necessarily**
     * @type string **necessarily**
     * @treetIds/@file json array ObjectId of entities which is trees or file with product in zip format **necessarily**
     * @groupId if owner of the group
     * @description string product description
     * @shortDescription string product short description
     * @access int interaction_mask
     * @icon string base64 icon
     * @cost int product cost, default 0, not used at the moment.
     * @translation string json product translations, example {"ru":{"title":"Заголовок", "description": "описание на русском", ...}, "en":{...}}
     * @return string 200 Ok
     */
    /api/v2/purchase/createProduct
 
    /**
     * GET
     * Action for get product information.
     * @productId string ObjectId of entity which is product
     * @return string 200 product information
     */
    /api/v2/purchase/getProduct
 
    /**
     * GET
     * Action return all available product, excluding users products.
     * Filters: 
     * @access int interaction_mask, /in development
     * @type string (tree/map), /in development
     * @point json {"lon":86.696379, "lat":54.153597} /in development
     * @return string 200 products 
     */
    /api/v2/purchase/getProducts
 
    /**
     * GET
     * Action for purchase product
     * @productId string ObjectId of entity which is product
     * @return string 200 OK
     */
    /api/v2/purchase/purchaseProduct
 
    /**
     * POST
     * Action for product update.
     * @productId string ObjectId of entity which is product **necessarily**
     * @title string product name
     * @treeIds json array ObjectId trees
     * @file file in zip format
     * @description string product description
     * @shortDescription string product short description
     * @access int interaction_mask
     * @icon string base64 icon
     * @cost map string - double.
     * @translation string json product translations, example {"ru":{"title":"Заголовок", "description": "описание на русском", ...}, "en":{...}}
     * @return string 200 Ok
     */
    /api/v2/purchase/updateProduct
 
    /**
     * GET
     * Action for product remove from user or from bd if user is owner.
     * @productId string ObjectId of entity which is product
     * @return string 200 Ok
     */
    /api/v2/purchase/removeProduct
 
    /**
     * GET
     * Action for product get version.
     * @productId string ObjectId of entity which is product
     * @return string 200 product version
     */
    /api/v2/purchase/getProductVersion   
 
    /**
     * Action for get user products
     * return string 200 user products
     */
     /api/v2/purchase/getUserProducts
 
    /**
     * GET
     * @text string feedback text
     * @productId ObjectId product id
     * @return string 200 Ok
     */
    public function postFeedbackAction()
 
    /**
     * GET
     * @productId ObjectId product id
     * @return array 200 product feedback
     */
    public function getProductFeedbackAction()
 
    /**
     * GET
     * Action for get product file
     * @productId ObjectId product id
     * @return product file
     */
    public function getProductFileAction()
 
    /**
     * Action set sidebar text pattern.
     * @layerId string ObjectId
     * @pattern string sidebar text pattern
     * @return string 200 Ok
     */
    /api/v2/node/setSideBar
 
    /**
     * Action get sidebar text pattern.
     * @layerId string ObjectId
     * @return string 200 Ok
     */
    /api/v2/user/getSideBar
 
    /**
     * Action find user by name.
     * @name string userName regexp.
     * if name =='' return all users, else search by regexp
     * @return string 200 [userId,name]
     */
    /api/v2/user/findUsersByNames
 
    /**
     * Action find tree by name.
     * @name string treeName regexp.
     * @return string 200 [treeId,name]
     */
    /api/v2/node/searchTreeByName
 
    /**
     * POST
     * Action create layers object
     * @layerId ObjectId layers id
     * @treeId ObjectId tree Id
     * @geometry string geo json geometry
     * @properties string json properties
     * @return 200 new objectId
     */
    /api/v2/node/createObject
 
    /**
     * POST
     * Action update layers object
     * @objectId ObjectId layer object id
     * @layerId ObjectId layer id
     * @treeId ObjectId tree Id
     * @objectId ObjectId layer object id
     * @geometry geojson geometry
     * @properties json properties
     * @return 200 Ok
     */
    /api/v2/node/updateObject
 
    /**
     * POST
     * Action remove layers object
     * @treeId ObjectId tree id
     * @layerId ObjectId layer id
     * @objectId ObjectId layer object id
     * @return 200 Ok
     */
    /api/v2/node/removeObject
 
    /**
     * POST
     * Action change the layer for a layer object
     * @layerId objectId layers id
     * @newLayerId objectId new layers id
     * @treeId ObjectId tree id
     * @objectId ObjectId layer object id
     * @return 200 Ok
     */
    /api/v2/node/changeLayerObject
 
    /**
     * Action activate users devices.
     * @request string *
     * @providerId string *
     * @receipt string for iOs devices.
     * @web int if from webbrowser
     * @os string devices OS
     * @purchaseId string purchaseToken or pincode
     * @return 200 Ok
     */
    /api/v2/purchase/activate
 
    /**
     * POST
     * Action confirm paid products
     * @productId objectId product id
     * @purchaseName string purchases name
     * @return 200 Ok
     */
    /api/v2/purchase/productPayConfirm
 
    /**
     * GET
     * Action get unconfirmed paid products
     * @return 200 Ok json
     */
    /api/v2/purchase/getUnconfirmedPaidProduct
 
    /**
     * GET
     * Action get help objects
     * @return 200 Ok json help objects
     */
    /api/v2/help/get
 
    /**
     * POST
     * Action add help object
     * @help json help object
     * @file file help media file
     * @return 200 Ok
     */
    /api/v2/help/add
 
    /**
     * POST
     * Action update the help object
     * @helpObjectId objectId help object id
     * @help json help object
     * @file file help media file
     * @return 200 Ok
     */
    /api/v2/help/update
 
    /**
     * POST
     * Action remove help object
     * @helpObjectId objectId help object id
     * @return 200 Ok
     */
    /api/v2/help/remove
 
    /**
     * Rebuild user menu
     */
    /api/v2/user/rebuildUserMenu
 
    /**
     * Upload track
     * @file gpx format
     */
    /api/v2/node/uploadTrack
 
    /**
     * GET
     * Get user search
     */
    /api/v2/user/getUserSearch
 
    /**
     * GET
     * Get user search
     */
    /api/v2/user/getUserSearch
 
    /**
     * GET
     * Action get url
     * @url string needed url
     * @return 200 string url
     */
    /api/v2/url/get
 
    /**
     * Action get tracker
     * @token QR token or auth token
     * @id tracker id
     * @return 200 array trackers
     */
    /api/v2/tracker/get
 
    /**
     * Action create tracker
     * @tracker raw json data
     * @return 200 json tracker object
     */
    /api/v2/tracker/create
 
    /**
     * Action update tracker
     * @tracker raw json data(id necessary)
     * @return 200 OK
     */
    /api/v2/tracker/update
 
    /**
     * Action delete tracker
     * @id tracker id
     * @return 200 OK
     */
    /api/v2/tracker/delete
 
    /**
     * POST
     * Action connect device to tracker
     * @token auth device token
     * @trackerId tracker id
     * @return 200 array trackers
     */
    /api/v2/tracker/connect
 
    /**
     * POST
     * Action send data to tracker module
     * @token JWT auth device token
     * @type string type object (location/object)
     * @body json object
     * @schemeId scheme id(if type object)
     * @return 200 array trackers
     */
    /api/v2/tracker/send
 
    /**
     * POST
     * Action get temp QR token
     * @trackerId/@layerId ObjectId tracker id/layer id
     * @return 200 Ok token
     */
    /api/v2/QR/get
 
    /**
     * POST
     * Action get token for access to tracker module
     * @token temp QR token or auth token
     * @deviceId device id
     * @trackerId tracker module id for auth token
     * @return 200 Ok or errors array
     */
    /api/v2/QR/auth
 
    /**
     * POST
     * Action get token with layer id
     * @layerId objectId layers id
     * @return 200 string JWT
     */
    api/v2/node/getSubscriptionToken
 
    /**
     * POST
     * Action create scheme
     * Raw json data
     * @return 200 Ok json scheme object
     */
    api/v2/scheme/create
 
    /**
     * GET
     * Action get scheme by id
     * @id ObjectId scheme id
     * @layerId ObjectId layer id(tracker id)
     * @type string scheme type (Verification, Collector, Tracker, Command)
     * @return 200 Ok json scheme object
     */
    api/v2/scheme/get
 
    /**
     * POST
     * Action update scheme
     * Raw json data (necessarily "_id")
     * @return 200 Ok
     */
    api/v2/scheme/update
 
    /**
     * POST
     * Action delete scheme by id
     * @id scheme id
     * @return 200 Ok
     */
    api/v2/scheme/delete
 
    /**
     * POST
     * Action verification object
     * @schemeId ObjectId scheme id
     * @objectId ObjectId object id
     * @return 200 Ok or errors array
     * Error codes: 
     *  1: Fields not found
     *  2: Empty value
     *  3: Invalid type. Value must be string/int/bool
     *  4: Invalid value, must be one of the list [...]
     */
    api/v2/scheme/verification
 
    /**
     * GET
     * Get upload logs
     * @layerId ObjectId layer id
     * @return 200 OK log urls
     */
    /api/v2/user/getUploadLogs
 
    /**
     * GET
     * Action for get user organization.
     * @return string json object organization
     */
    /api/v2/organization/get
 
    /**
     * POST
     * Action for update organization info.
     * @name new organization name
     * @return 200 OK
     */
    /api/v2/organization/update
 
    /**
     * GET
     * Action for get portal.
     * @return 200 json object all connection portals
     */
    /api/v2/portal/get
 
    /**
     * POST
     * Action for create portal.
     * @name string portal name
     * @settings json portal settings
     * @productId array portal products
     * @open string 'true'/'false'
     * @private string 'true'/'false'
     * @groups array portal groups
     * @helps array portal helps
     * @return object tree mongoDB object
     */
    /api/v2/portal/create
 
    /**
     * POST
     * Action for delete portal.
     * @id string portal id, if id is empty remove all portals
     * @return 200 OK
     */
    /api/v2/portal/remove
 
    /**
     * POST
     * Action for delete all organization portals. And create default portal.
     * @return 200 OK
     */
    /api/v2/portal/removeAll
 
    /**
     * POST
     * Action for update portal.
     * @id portal id
     * @name string portal name
     * @settings array portal settings
     * @productId array portal products
     * @open string 'true'/'false' or int 1/0
     * @private string 'true'/'false' or int 1/0
     * @groups array portal groups
     * @helps array portal helps
     * @return object tree mongoDB object
     */
    /api/v2/portal/update
 
    /**
     * GET
     * Action get news objects
     * @param ObjectId $id news id
     * @param string $type news type
     * @return 200 Ok json news objects
     */
    /api/v2/news/get
 
    /**
     * GET
     * Action for get callbacks
     */
    /api/v2/callback/get
 
    /**
     * POST
     * Action for add callback
     * @param string $name caller name
     * @param string $message message
     * @param string $phone phone number
     * @param string $product product title
     * @return 200 OK Callback object
     */
    /api/v2/callback/create
 
    /**
     * POST
     * Action for delete callback
     * @param ObjectId id callback object id
     * @return 200 Ok
     */
    /api/v2/callback/delete
 
    /**
     * POST
     * Action for update callback
     * @param ObjectId id callback object id
     * @param string $name caller name
     * @param string $message message
     * @param string $phone phone number
     * @param string $product product title
     */
    /api/v2/callback/update
 
    /**
     * GET
     * Getting a search list
     * @param integer $portalId Portal id. Is required.
     * @param ObjectId $id Searching id.
     * @return status 200/400/403 message searching list code 0
     */
    /api/v2/searching/get
 
    /**
     * POST
     * Create searching object action
     * @param integer $portalId Portal id. Is required.
     * @param string $name Searching name
     * @param base64 $icon Searching icon
     * @param json $dataSets Array searching dataSets in json format.
     * @param json $examples Array searching examples in json format.
     * @return status 200 message OK code 0
     */
    /api/v2/searching/create
 
    /**
     * Update searching object action
     *
     * @param ObjectId $id Searching object id. Is required.
     * @param integer $portalId Portal id. Is required.
     * @param string $name Searching name
     * @param base64 $icon Searching icon
     * @param json $dataSets Array searching dataSets in json format.
     * @param json $examples Array searching examples in json format.
     * @return status 200 message OK code 0
     */
     /api/v2/searching/update
 
    /**
     * Delete searching object action by id
     * @param ObjectId $searchingId Searching object id. Is required.
     * @param integer $portalId Portal id. Is required.
     * @return  200 Ok
     */
     /api/v2/searching/delete
 
    /**
     * GET
     * Perform user search
     * @param string $type Search type(user/system)
     * @param string $query Search query
     * @param string $backName Only for system searchEngine
     * @param ObjectId $searchId SearchEngine id, only for user searchEngine
     * @return 200 OK searching result
     */
     /api/v2/user/performUserSearch

Tree

{
  _id: ObjectID;
  "properties": {
    "type": "tree",
    "name": string,
    "ownerId": ObjectID,
    "shared": "free"/"private"
  },
  "options" : {
    "iconOptions" : {
            "type" : "default"/"user"/"none"//default иконка создаётся на стороне back-end, 
            user загружена пользователем, none - отсутствие иконки
            "icon" : base64
        }
  }
  "children": []/null;
}

Directory

{
  _id: ObjectID;
  "properties": {
    "type": "dir";
    "name": string;
  },
  "options" : {
    "iconOptions" : {
            "type" : "default"/"user"/"none"//default иконка создаётся на стороне back-end, 
            user загружена пользователем, none - отсутствие иконки
            "icon" : base64
        }
  },
  "children": []/null
}

Layer

{
  "properties": {
    "type": "layer",
    "api": string,
    "alias": ObjectID 
  },
  "options" : {
    "iconOptions" : {
            "type" : "default"/"user"/"none"//default иконка создаётся на стороне back-end, 
            user загружена пользователем, none - отсутствие иконки
            "icon" : base64
        }
  }
  "children": []/null
}

Layer Entity

{
    "_id" : ObjectId("5cffac95ec8fc0140f5c9c82"),
    "properties" : {
        "type" : "layerEntity",
        "name" : "Some name",
        "api" : "api/v2/node/getobjs?type=Layer&id=5cffac95ec8fc0140f5c9c82",
        "parentId" : ObjectId("5cffac86ec8fc014102af2d2"),
        "treeId" : ObjectId("5cffac86ec8fc014102af2d2"),
        "filter" : ""
    },
    "children" : [],
    "options" : {
        "isPreviewActive" : false,
        "description" : "{{#date}}Дата: <b>{{date}}</b><br>{{/date}}\n{{#time}}Time: {{time}}<br>
        {{/time}}\n{{#cost}}Cost: <b>{{cost}}</b><br>{{/cost}}\n{{message}}",
        "uniqueUploadFields" : [],
        "updated" : {
            "value" : false,
            "time" : 0
        },
        "track" : {
            "value" : null,
            "description" : null
        },
        "lineOptions" : {
            "color" : "#4047ff",
            "weight" : 3,
            "opacity" : 1,
            "zoom" : 1
        },
        "multiPolygonOptions" : {
            "color" : "#fff927",
            "weight" : 4,
            "opacity" : 1,
            "fillOpacity" : 0.5,
            "zoom" : 1
        },
        "pointOptions" : {
            "markerType" : "marker",
            "zoom" : 1,
            "iconOptions" : {
                "iconUrl" : "https://unpkg.com/leaflet@1.3.4/dist/images/marker-icon.png",
                "iconSize" : [ 
                    25, 
                    41
                ],
                "iconAnchor" : [ 
                    20, 
                    40
                ]
            },
            "markerOptions" : {
                "type" : "circle",
                "radius" : 10,
                "numberOfSides" : 3,
                "rotation" : 0,
                "color" : "#1eb004",
                "weight" : 1,
                "fillOpacity" : 0.8,
                "fillColor" : "#3c794e"
            }
        },
        "dataSetId" : ObjectId("5cffac95ec8fc0140f5c9c83"),
        "filter" : "string",
        "iconOptions" : {
            "type" : "default"/"user"/"none"//default иконка создаётся на стороне back-end, 
            user загружена пользователем, none - отсутствие иконки
            "icon" : base64
        }
    }
}

Map

{
  _id: ObjectID;
  properties: {
    type: "map";
    typeMap: "osm"/"2gis"/"mapbox"/"yandex"/"google",
    name: string;
    url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
    urlCache: "http://cache.mrgis02.mrsks.local/osm/{z}/{x}/{y}.png",
    options: {
      maxZoom: 18
    },
    checked: 1,
    cache: 0,
  }
}

overlayLayer

{
	"properties": {
		"type": "overlayLayer",
		"name": "Зоны с особыми условиями использования территории",
		"url": "//pkk5.rosreestr.ru/arcgis/rest/services/Cadastre/ZONES/MapServer/export?",
		"options": {
			"format": "image/png",
			"transparent": "true",
			"tileSize": 256,
			"zIndex": 100,
			"shiftX": 0,
			"shiftY": 0,
			"maxZoom": 18
		},
		"checked": false
	}
}

Tokens

Response header
// Access open
Authorization: 0;
// Expired token
Authorization: 1;
// Access denied
Authorization: 2;
// Some error
Authorization: 3;
// To much requests
Authorization: 4;
 
// Refresh Token
refresh_token : some_token;
// Access Token
access_token : some_token;

Users

{
  _id: ObjectID,
  name: string,
  email: string,
  password: bcrypt,
  time: time,
  groups: [
      groupId(ObjectID),
      groupId(ObjectID)
  ],
  products: [
    productId(ObjectID),
    productId(ObjectID)
  ]
}

Interaction mask (interaction_mask)

// 0 uses for invisible groups or products. Users can get access from owner invite only.
0 - invite
// Users can sent invite to owner groups or products.
1 - private
// Users can join to group without limitations.
2 - public
// Users can buy product.
3 - buy
// Users can get product, if they have premium account.
4 - premium

Mask of access for groups (group_mask)

// Mask of access to group/product. Can take 3 values 1 - read, 2 - write, 4- access.
// For groups
Read allows to see group members, write allows to add group members, access allows do delete and configure group. 
// For example
// User doesn't have access to group/product. 
0
//user has access to group/product.
4

Groups

{
  _id: ObjectID,
  name: string
  access: interaction_mask,
  users: [
    {
      userId: ObjectID,
      mask: group_mask
    }
  ],
  tree: [
    {
      treeId: ObjectID,
      mask: group_mask
    }
  ],
}

Products

{
  _id: ObjectID,
  owner: {
      userId/groupId : ObjectID
  },
  treeIds[]/file: ObjectID/filepath,
  type: string(tree/map),
  access: interaction_mask,
  title: string,
  description: text,
  shortDescription: text,
  shortDescription: text,
  icon: icon,
  cost: [
      string(ISO 3166-1 alpha-3) : double,
      ...
  ],
  users: [
      ObjectID
  ],
  purchaseId : string  
}

Translations

{
    "_id" : ObjectId,
    "language" : string,
    "code" : string,
    "phrases" : {
        "phrases" : "phrases translate",
        ...
    }
}

Orders

{
    "_id" : ObjectId,
    "userId" : ObjectId,
    "providerId" : ObjectId,
    "productId" : ObjectId/string,
    "softExpire" : int,
    "hardExpire" : int,
    "cost" : float,
    "date" : Date,
    "activation" : {
        "token" : string,
        "activated" : boolean,
        "activatedDate" : Date,
        "deviceId" : string,
        "serialNumber" : stirng,
        "expired" : boolean
    }
}

Helps

{
    title : string,
    order : int,
    text: string,
    url: string,
    type: string("Video"/"Image")
}

Device

{
    "_id" : ObjectId,
    "properties" : {
        "deviceId" : string,
        "trackers" : [ 
            {
                "trackerId" : ObjectId,
                "status" : 0/1
            }
        ]
    },
    "geometry" : {
        "type" : "Point",
        "coordinates" : [ 
            double, 
            double        
        ]
    }
}

Scheme

Verification

{
    "_id" : ObjectId(""),
    "type" : "Verification",
    "dataSetId" : ObjectId(""),
    "name" : "Some name",
    "organizationId" : ObjectId(""),
    "fields" : [ 
        {
            "name" : "some name 1",
            "type" : "string"
        }, 
        {
            "name" : "some name 2",
            "type" : "int"
        },
        {
            "name" : "some name 3",
            "type" : "double"
        },
        {
            "name" : "some name 4",
            "type" : "list",
            "value" : array<string>
        },
        {
            "name" : "some name 5",
            "type" : "boolean"
        } 
    ]
}

Collector

{
    "_id" : ObjectId(""),
    "type" : "Collector",
    "name" : "Some name",
    "trackerId" : ObjectId(""),
    "dataSetId" : ObjectId(""),
    "uniqueField" : string,
    "organizationId" : ObjectId("")
    [ 
        {
            "name" : "Params 1",
            "type" : "int/double/boolean/string/list",
            "value" : "some value"/array<string>,//Необязательный параметр,  
            //может быть массивом если list, для list обязательный параметр
            "required" : bool
        },
        {
            "name" : "Params 2",
            "type" : "list",
            "value" : [
              "Some value",
              "Another value"
            ],
            "required" : bool
        },
        {
            "name" : "Params 3",
            "type" : "number",
            "value" : 20,
            "required" : bool
        },
        {
            "name" : "Params 4",
            "type" : "string",
            "required" : bool
        }
    ]
}

Tracker

{
    "_id" : ObjectId(""),
    "type" : "Tracker",
    "name" : "Some name",
    "trackerId" : ObjectId(""),
    "dataSetId" : ObjectId(""),
    "organizationId" : ObjectId("")
}

Command

{
    "_id" : ObjectId(""),
    "type" : "Command",
    "dataSetId" : ObjectId(""),
    "name" : "Some name",
    "organizationId" : ObjectId(""),
    "command" : "message",
    "trackerId" : ObjectId(""),
    "fields" : [ 
        {
            "name" : "Params 1",
            "type" : "list",
            "value" : [ 
                "Params 1", 
                "Params 2"
            ]
        }
    ]
}

Trackers

{
    "_id" : ObjectId,
    "owner" : ObjectId,
    "name" : string,
    "OpenAPI" : bool,
    "QR" : bool,
    "Auth" : array[ 
        ObjectId,
        ...
    ]
}

Category

{
    "_id" : ObjectId(""),
    "type": "user",
    "dataSetId" : ObjectId(""),
    "name" : "Some name",
    "geometryType" : "Point/LineString/Polygon",
    "img" : base64,
    "fields" : [ 
        {
            "name" : "Params 1",
            "type" : "double/boolean/string/list",
            "value" : "some value"/array<string>,//Необязательный параметр,  
            //может быть массивом если list, для list обязательный параметр
            "required" : bool
        },
        {
            "name" : "Params 2",
            "type" : "list",
            "value" : [
              "Some value",
              "Another value"
            ],
            "required" : bool
        },
        {
            "name" : "Params 3",
            "type" : "number",
            "required" : bool
        },
        {
            "name" : "Params 4",
            "type" : "string",
            "required" : bool
        }
    ]
},
 
{
    "_id" : ObjectId(""),
    "type": "system",
    "name" : "Name of translation",
    "geometryType" : "Point/LineString/Polygon",
    "img" : 'mat-icon name'
}

Tracks

{
    "_id" : ObjectId,
    "deviceId" : string,
    "lon" : double,
    "lat" : double,
    "time" : ISODate
}

Tracks body /api/v2/tracker/send

{
    "deviceId" : string,
    "lon" : double,
    "lat" : double
}

Upload file log

{
    "_id" : ObjectId,
    "time" : ISODate,
    "userId" : ObjectId,
    "logFile" : string,
    "status" : string upload/progress/success/error,
    "dataSetId" : ObjectId,
    "fileName": string
}

Organization

{
    _id: ObjectId,
    name: string organization name
    ownerId: Objectid user id,
    portals: [] ObjectId portals
}

Portal

{
    _id: ObjectId,
    name: string portal name,
    url: string portal url,
    setting: {},
    organizationId: ObjectId organization id
    productId: [],
    searchId: [],
    open: bool,
    private: bool,
    groups: [],
    helps: []
}

PortalConnection

{
    userId: ObjectId,
    portalId: ObjectId,
    access: bool
}

News

{
    "_id" : ObjectId,
    "type" : string airlay/navikey/7ways,
    "title" : string,
    "message" : string,
    "image" : base64,
    "time" : ISODate
}

Callback

{
    "_id" : ObjectId,
    "name" : string,
    "message" : string,
    "phone" : NumberLong,
    "product" : string,
    "time" : ISODate
}

SearchEngine

{
    _id: ObjectId,
    'name' : string( 'Поиск по координатам'), 
    'type' : string('system'/'user'), 
    'icon' : base64(img),
    'examples' : array[string],
    'portalId' : int,
    // Если type = system
    'backName' : string,
    // Если type = user
    'dataSets' : Array
    [
        {
            'dataSetId' : objectID,
            'type' : string('equal', 'notequal', 'entry', 'start', 'end', 'regexp', 'smart'),
            'register' : bool,
            'fields' : Array<string>,
            "name" : string,
            'datasetUniqueField' : string,
        }
    ]
}

Filter

{
  "dataSetId" : ObjectId(""),
  "name" : "string",
  "filter": [
    {
      "field" : "string"//атрибут
      "type" : "string"/"number"/"date",//тип фильтра,
      "alias" : "string" //псевдоним
    }
  ]
}

ru/airlay/api/air-lay-v2.txt · Последние изменения: 2020/01/23 16:21 — Александр