Searching...

Matching results

    Zone

    A zone is a geographical representation following GeoJSON specification. For now only polygon geometry type is supported.

    /v1/zones

    Returns the list of existing zones for this company.

    Request

    GET https://na.airvantage.net/api/v1/zones

    Response
    200 OK

    HTTP/1.1 200 OK
    Content-Type: application/json
    ...
    [
        {
            "uid": "5fb2d9d38e9448eda1be174b9d177b9e",
            "name": "Delivery depot 1",
            "shape": {
                "type": "Polygon",
                "coordinates": [
                    [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                ]
            }
        }
    ]
    Name Description Use Default Type Operand
    company Set the context company. optional caller's company uid =
    HTTP Method GET
    Requires Authentication Yes
    Rate Limited Yes
    Headers None
    Permissions entities.zones.view

    /v1/zones

    Creates a new zone for the context company.

    Request

    POST https://na.airvantage.net/api/v1/zones
    Content-Type: application/json
    ...
    {
        "name": "Delivery depot 1",
        "shape": {
            "type": "Polygon",
            "coordinates": [
                [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
            ]
        }
    }

    Response
    200 OK

    HTTP/1.1 200 OK
    Content-Type: application/json
    ...
    {
        "uid": "828e0056636242b98badfd3eeb57455a",
        "name": "Delivery depot 1",
        "shape": {
            "type": "Polygon",
            "coordinates": [
                [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
            ]
        }
    }
    Name Description Use Default Type
    company Set the context company. optional caller's company uid
    Name Description
    zone.missing.name A zone name must be provided.
    zone.missing.shape A geographical shape must be provided.
    zone.invalid.shape Zone must be valid GeoJSON.
    not.enough.coordinates Zone polygon must have at least 4 points.
    too.many.polygons Zone shape must have at most 2 polygons.
    too.many.coordinates Zone polygon must have at most 12 coordinates.
    invalid.coordinates Zone polygon starting and ending coordinates must be equals.
    HTTP Method POST
    Requires Authentication Yes
    Rate Limited Yes
    Headers None
    Permissions entities.zones.create

    /v1/zones/{uid}

    Returns detailed information about the specified zone.

    Request

    GET https://na.airvantage.net/api/v1/zones

    Response
    200 OK

    HTTP/1.1 200 OK
    Content-Type: application/json
    ...
    [
        {
            "uid": "5fb2d9d38e9448eda1be174b9d177b9e",
            "name": "Delivery depot 1",
            "shape": {
                "type": "Polygon",
                "coordinates": [
                    [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                ]
            }
        }
    ]
    Name Description Use Default Type Operand
    company Set the context company. optional caller's company uid =
    HTTP Method GET
    Requires Authentication Yes
    Rate Limited Yes
    Headers None
    Permissions entities.zones.view

    /v1/zones/{uid}

    Deletes a zone matching the specified uid for the context company.

    Request

    DELETE https://na.airvantage.net/api/v1/zones/828e0056636242b98badfd3eeb57455a

    Response
    200 OK

    HTTP/1.1 200 OK
    Content-Length: 0
        
    Name Description Use Default Type
    company Set the context company. optional caller's company uid
    Name Description
    zone.unknown The specified 'uid' does not match with any existing zone.
    HTTP Method DELETE
    Requires Authentication Yes
    Rate Limited Yes
    Headers None
    Permissions entities.zones.delete
    TOP