API: POI

M: Listar geocercas

HTTP GET:

https://<hostname>/api/pois

URL PARAMETERS:

Este método soporta el uso de filtros.

OUTPUT:

EJEMPLO CON CURL:

curl -u <api_key>:<password>
     -X GET
     https://<hostname>/api/pois?page_size=2

RESPUESTA:

{
    "success": true,
    "data": [
        {
            "id": "1",
            "client_id": "67",
            "name": "San Francisco Restaurant",
            "use_as_address": "1",
            "y": "28.733676131611",
            "x": "-110.9776747226",
            "corners": "",
            "radius": "64",
            "geom": "01030000...2BB3C40",
            "area": "12868",
            "type": "0",
            "checkpoint_id": "0",
            "created_by": "134",
            "custom_map_id": "",
            "contact": "",
            "url": "",
            "is_round": "1",
            "creation_date": "2014-12-14 05:36:29+00",
            "changed_date": "2015-02-13 14:26:58+00",
            "deactivated": "0",
            "group_id":"1547",
            "custom_fields": {
                "owner": "Mario Batali",
                "max_capacity": 260
            },
            "user_ids": null,
            "photo_id": null,
            "remote_id":"SFRBATALI28110"
        },
        {
            "id": "51",
            "client_id": "5",
            "name": "Raquel Garcia",
            "use_as_address": "1",
            "y": "25.8365",
            "x": "-97.47022222220",
            "corners": "",
            "radius": "150",
            "geom": "01030000...663940",
            "area": "70.6858",
            "type": "2",
            "checkpoint_id": "0",
            "created_by": "",
            "custom_map_id": "",
            "contact": "",
            "url": "",
            "is_round": "1",
            "creation_date": "2015-02-15 02:16:48+00",
            "changed_date": "2016-03-20 22:35:02+00",
            "deactivated": "0",
            "group_id":"1547",
            "custom_fields": null,
            "user_ids": null,
            "photo_id": null,
            "remote_id": null
        }
    ]
}

M: Insertar geocerca

HTTP POST:

https://<hostname>/api/poi

BODY PARAMETERS:

OUTPUT:

EJEMPLO CON CURL:

curl -u <api_key>:<password>
     --data
     "name=ejemplo&use_as_address=1&radius=15&y=28.7&x=-100.1&type=0&group_id=1546"
     https://<hostname>/api/poi

RESPUESTA:

{
 "success": true,
 "id": "15398"
}

M: Actualizar geocerca

HTTP PUT:

https://<hostname>/api/poi/<id>

BODY PARAMETERS:

OUTPUT:

EJEMPLO CON CURL:

curl -u <api_key>:<password>
     -X PUT
     --data "name=ejemplo"
     https://<hostname>/api/poi/15398

RESPUESTA:

{
    "success": true,
    "data": {
        "id": "15398",
        "client_id": "158",
        "name": "ejemplo",
        "use_as_address": "1",
        "y": "28.7",
        "x": "-100.1",
        "corners": "",
        "radius": "15",
        "geom": "POLYGON((-100.1 28.7, -100.1 28.7, -100.1 28.7, -100.1 28.7))",
        "area": "70685.83470577",
        "type": "0",
        "checkpoint_id": "0",
        "created_by": "703",
        "custom_map_id": "",
        "contact": "",
        "url": "",
        "is_round": "1",
        "creation_date": "2016-03-14 21:12:43+00",
        "changed_date": "2016-03-14 21:12:43+00",
        "deactivated": "0",
        "group_id":"1547"
    }
}

O: POI Data Object

Cada objeto de geocerca tiene estos campos:

Campo Read-only Requerido Tipo de dato
id no texto
client_id no numérico
name no texto
use_as_address no no texto
x no texto coordenadas en grados
y no texto coordenadas en grados
corners no no texto
radius no numérico radio en metros
geom no texto
area no texto
type no numérico siempre enviar "0"
checkpoint_id no numérico
created_by no numérico
custom_map_id no numérico
route_id no no texto
contact no no texto
url no no texto
is_round no numérico
creation_date no fecha
changed_date no fecha
deactivated no no numérico
group_id no numérico id del grupo de geocercas
custom_fields no no texto json de campos personalizados. Debe ser válido según el Custom Fields Schema del Cliente.
user_ids no no lista
photo_id no no numérico
remote_id no no texto identificador configurable por el usuario. Debe ser único por Cliente.