Api doc


SDK's


Api Modules

location.location

Management of individual Location.



Supported Methods:

GET
Params
  • token (Required): valid token
  • id: integer
  • unique_id: varchar


CREATE
Params
  • token (Required): valid token
  • name (Required): varchar
  • type (Required): enum (1, 2)
  • country: varchar
  • address: varchar
  • lat: varchar
  • lon: varchar
  • timezone_id: integer
  • store: integer
  • unique_id: varchar


UPDATE
Params
  • token (Required): valid token
  • id: integer
  • unique_id: varchar
  • name: varchar
  • country: varchar
  • address: varchar
  • lat: varchar
  • lon: varchar
  • timezone_id: integer
  • notes: varchar
  • phone_number: varchar


DELETE
Params
  • token (Required): valid token
  • id: integer
  • unique_id: varchar


Documentation

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

--

Parameters:

  1. "id":required //Location id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"location.location",
  3. "method":"GET",
  4. "request":{
  5. "id":"38124"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"40456",
  5. "name":"New New York",
  6. "country":"US",
  7. "address":"United States",
  8. "lat":"37.09024",
  9. "lon":"-95.712891",
  10. "type":"1",
  11. "notes":"",
  12. "map":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+",
  13. "directions":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+"
  14. },
  15. "token":"xxxxxxx"
  16. }

---

CREATE
Creates new location.
Level 5 is required

--

Parameters:

  1. "name": required //Name (varchar)
  2. "type": required //Location type (enum[1,2])
  3. /* 1: for Location
  4.   * 2: for Remote Site */
  5. "country": accepted //Country (varchar)
  6. "address": accepted //Address (varchar)
  7. "lat": accepted //Latitude (varchar)
  8. "lon": accepted //Longitude (varchar)
  9. "timezone_id": accepted //Timezone id (integer)
  10. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"location.location",
  3. "method":"CREATE",
  4. "request":{
  5. "name":"newLocation",
  6. "type":"1"
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"40828",
  5. "name":"newLocation",
  6. "country":"",
  7. "address":"",
  8. "lat":"",
  9. "lon":"",
  10. "type":"1",
  11. "notes":"",
  12. "map":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+",
  13. "directions":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+"
  14. },
  15. "token":"xxxxxxx"
  16. }

---

UPDATE
Updates location.
Level 5 is required

--

Parameters:

  1. "id": required //Location id (integer)
  2. "name": accepted //Location name (varchar)
  3. "country": accepted //Country (varchar)
  4. "address": accepted //Address (varchar)
  5. "lat": accepted //Latitude (varchar)
  6. "lon": accepted //Longitude (varchar)
  7. "timezone_id": accepted //Timezone id (integer)
  8. "notes": accepted //Notes (varchar)
  9. "token": "xxxxxxx" //Valid token is required

Example request:

  1. {
  2. "module":"location.location",
  3. "method":"UPDATE",
  4. "request":{
  5. "id":"40828"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"40828",
  5. "name":"newLocation",
  6. "country":"PlanetFederation",
  7. "address":"",
  8. "lat":"",
  9. "lon":"",
  10. "type":"1",
  11. "notes":"",
  12. "map":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+",
  13. "directions":"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=%2C+"
  14. },
  15. "token":"f25a14018a61920589d1e04bd812ee95b8956d24"
  16. }

---

DELETE
Deletes location.
Level 5 is required

--

Parameters:

  1. "id": required //Location id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"location.location",
  3. "method":"DELETE",
  4. "request":{
  5. "id":"40828"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":"Location Removed",
  4. "token":"xxxxxxx"
  5. }