location.location

Management of individual Location.

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)integerLocation id

CREATE

ParametersTypeDescription
token (required)Valid token
name (required)varcharName
type (required)enum (1, 2)1: for Location
2: for Remote Site
country (accepted)varcharCountry
address (accepted)varcharAddress
lat (accepted)varcharLatitude
lon (accepted)varcharLongitude
timezone_id (accepted)integerTime zone id

UPDATE

ParametersTypeDescription
tokenValid token
id (required)integerLocation id
name (accepted)varcharLocation name
country (accepted)varcharLocation country
address (accepted)varcharLocation address
lat (accepted)varcharLatitude
lon (accepted)varcharLongitude
timezone_id (accepted)integerTime zone id
notes (accepted)varcharNotes
phone_number (accepted)varcharPhone number

DELETE

ParametersTypeDescription
token (required)Valid token
id (required)integerLocation id

DOCUMENTATION

GET
Retrieves an individual location specified by id.
Level 5 is required

--

Example Request:

{
   "module":"location.location",
   "method":"GET",
   "request":{
      "id":"613062"
   }
}

Example Response:

{
    "status": 1,
    "data": {
        "id": 613062,
        "name": "Abraco",
        "country": "",
        "address": "86 East 7th Street, New York, NY 10003, USA",
        "lat": 0,
        "lon": 0,
        "store": 202039,
        "type": 1,
        "notes": "",
        "timezone_id": null,
        "map": "https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=86+East+7th+Street%2C+New+York%2C+NY+10003%2C+USA%2C+",
        "directions": "https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=86+East+7th+Street%2C+New+York%2C+NY+10003%2C+USA%2C+"
    },
    "token": "xxxxxxxx"
}

CREATE
Creates new location.
Level 5 is required

--
Example Request:

{
   "module":"location.location",
   "method":"CREATE",
   "request":{
      "name":"newLocation",
      "type":"1"
   }
}

Example Response:

{
   "status":1,
   "data":{
      "id":"40828",
      "name":"newLocation",
      "country":"",
      "address":"",
      "lat":"",
      "lon":"",
      "type":"1",
      "notes":"",
      "map":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+",
      "directions":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+"
   },
   "token":"xxxxxxx"
}

UPDATE
Updates location.
Level 5 is required

--

Example request:

{
   "module":"location.location",
   "method":"UPDATE",
   "request":{
      "id":"40828",
      "country":"PlanetFederation"
   }
}

Example Response:

{
   "status":1,
   "data":{
      "id":"40828",
      "name":"newLocation",
      "country":"PlanetFederation",
      "address":"",
      "lat":"",
      "lon":"",
      "type":"1",
      "notes":"",
      "map":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+",
      "directions":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+"
   },
   "token":"f25a14018a61920589d1e04bd812ee95b8956d24"
}

DELETE
Deletes location.
Level 5 is required

--

Example Request:

{
   "module":"location.location",
   "method":"DELETE",
   "request":{
      "id":"40828"
   }
}

Example Response:

{
   "status":1,
   "data":"Location Removed",
   "token":"xxxxxxx"
}