Difference between revisions of "Sensaphone.net API/coordinates"
From Sensaphone.net
								
												
				|  (Created page with "=Sensaphone.net API= ==Specifications== The '''coordinates''' object holds latitude and longitude coordinates. It is not an individual (top-level) API resource, but is ins...") |  (→Sensaphone.net API:  Update Session data type.) | ||
| (One intermediate revision by one other user not shown) | |||
| Line 8: | Line 8: | ||
| }}{{TableRowN| ''<parent>''         | coordinates    | Object         | The coordinates object.  | ''' ''' | ''' ''' | '''✓''' | '''n/a''' | }}{{TableRowN| ''<parent>''         | coordinates    | Object         | The coordinates object.  | ''' ''' | ''' ''' | '''✓''' | '''n/a''' | ||
| }}{{TableRowN| coordinates          | coordinates_id | Integer        | ID of the address.       | ''' ''' | ''' ''' | '''✓''' | ''' ''' | }}{{TableRowN| coordinates          | coordinates_id | Integer        | ID of the address.       | ''' ''' | ''' ''' | '''✓''' | ''' ''' | ||
| − | }}{{TableRowN| coordinates          |  | + | }}{{TableRowN| coordinates          | lng              | Floating Point |  Longitude               | ''' ''' | ''' ''' | '''✓''' | '''✓''' | 
| − | }}{{TableRowN| coordinates          |  | + | }}{{TableRowN| coordinates          | lat              | Floating Point | Latitude                | ''' ''' | ''' ''' | '''✓''' | '''✓''' | 
| + | }}{{TableRowN| coordinates          | cached              | Boolean | Are coordinates from geocoding cache                | ''' ''' | ''' ''' | '''✓''' | ''' ''' | ||
| }}{{TableEnd}} | }}{{TableEnd}} | ||
| Line 18: | Line 19: | ||
| *Retrieve the latitude coordinate for a particular device's address. | *Retrieve the latitude coordinate for a particular device's address. | ||
| − |     '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/{DEVICE_ID}/coordinates/ | + |     '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/{DEVICE_ID}/coordinates/lat | 
| '''JSON Mode Request URI:''' | '''JSON Mode Request URI:''' | ||
| Line 27: | Line 28: | ||
| }}{{TableRowN| '''Parent Properties''' | '''Child Properties''' | '''Type'''       | '''Description''' | }}{{TableRowN| '''Parent Properties''' | '''Child Properties''' | '''Type'''       | '''Description''' | ||
| }}{{TableRowN|                    | acctid                 | Integer          | Account ID | }}{{TableRowN|                    | acctid                 | Integer          | Account ID | ||
| − | }}{{TableRowN|                    | session                |  | + | }}{{TableRowN|                    | session                | String           | Session Token | 
| }}{{TableRowN|                    | request_type           | String           | "read" | }}{{TableRowN|                    | request_type           | String           | "read" | ||
| }}{{TableRowN|                    | ''<parent object(s)>'' | Array of Objects | The parent(s) of the "address" resource, if any. See the [[Sensaphone.net_API#List|'''list''']]. | }}{{TableRowN|                    | ''<parent object(s)>'' | Array of Objects | The parent(s) of the "address" resource, if any. See the [[Sensaphone.net_API#List|'''list''']]. | ||
| Line 39: | Line 40: | ||
| }}{{TableRowN| ''<parent>''              | coordinates             | Required     | Array of Objects | Address data | }}{{TableRowN| ''<parent>''              | coordinates             | Required     | Array of Objects | Address data | ||
| }}{{TableRowN| coordinates               | coordinates_id          | Required     | Integer          | ID of the address. | }}{{TableRowN| coordinates               | coordinates_id          | Required     | Integer          | ID of the address. | ||
| − | }}{{TableRowN| coordinates               |  | + | }}{{TableRowN| coordinates               | lng                       | Optional     | Floating Point           | Longitude | 
| − | }}{{TableRowN| coordinates               |  | + | }}{{TableRowN| coordinates               | lat                       | Optional     | Floating Point           | Latitude | 
| + | }}{{TableRowN| coordinates               | cached                       | Optional     | Boolean           | Are coordinates from geocoding cache | ||
| }}{{TableEnd}} | }}{{TableEnd}} | ||
| Line 74: | Line 76: | ||
|           { |           { | ||
|             "coordinates_id": 28487, |             "coordinates_id": 28487, | ||
| − |             " | + |             "lat": 39.868809, | 
| − |             " | + |             "lng": -75.674508 | 
|           } |           } | ||
|          ] |          ] | ||
| Line 85: | Line 87: | ||
| ===PUT=== | ===PUT=== | ||
| '''URI Mode Request URI's:''' | '''URI Mode Request URI's:''' | ||
| − | *Edit the coordinates's  | + | *Edit the coordinates's latitude coordinate. | 
| − |     '''PUT''' https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/device/{DEVICE_ID}/coordinates/ | + |     '''PUT''' https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/device/{DEVICE_ID}/coordinates/lat/{LATITUDE} | 
| '''JSON Mode Request URI:''' | '''JSON Mode Request URI:''' | ||
| Line 95: | Line 97: | ||
| }}{{TableRowN| '''Parent Properties''' | '''Child Properties'''   | '''Type'''       | '''Description''' | }}{{TableRowN| '''Parent Properties''' | '''Child Properties'''   | '''Type'''       | '''Description''' | ||
| }}{{TableRowN|                    | acctid                   | Integer          | Account ID | }}{{TableRowN|                    | acctid                   | Integer          | Account ID | ||
| − | }}{{TableRowN|                    | session                  |  | + | }}{{TableRowN|                    | session                  | String           | Session Token | 
| }}{{TableRowN|                    | request_type             | String           | "read" | }}{{TableRowN|                    | request_type             | String           | "read" | ||
| }}{{TableRowN|                    | ''<parent object(s)>''   | Array of Objects | The parent(s) of the "address" resource, if any. See the [[Sensaphone.net_API#List|'''list''']]. | }}{{TableRowN|                    | ''<parent object(s)>''   | Array of Objects | The parent(s) of the "address" resource, if any. See the [[Sensaphone.net_API#List|'''list''']]. | ||
| Line 109: | Line 111: | ||
| }}{{TableRowN| ''<parent>''              | coordinates             | Required     | Array of Objects | Address data | }}{{TableRowN| ''<parent>''              | coordinates             | Required     | Array of Objects | Address data | ||
| }}{{TableRowN| coordinates               | coordinates_id          | Required     | Integer          | ID of the address. | }}{{TableRowN| coordinates               | coordinates_id          | Required     | Integer          | ID of the address. | ||
| − | }}{{TableRowN| coordinates               |  | + | }}{{TableRowN| coordinates               | lng                       | Optional     | Floating Point           | Longitude | 
| − | }}{{TableRowN| coordinates               |  | + | }}{{TableRowN| coordinates               | lat                       | Optional     | Floating Point           | Latitude | 
| }}{{TableEnd}} | }}{{TableEnd}} | ||
Latest revision as of 11:37, 10 July 2025
Sensaphone.net API
Specifications
The coordinates object holds latitude and longitude coordinates. It is not an individual (top-level) API resource, but is instead used in conjunction with other resources (e.g. devices).
The coordinates resource has the following properties:
| Parent Property | Property | Type | Description | Create | Delete | Read | Update | 
| <parent> | coordinates | Object | The coordinates object. | ✓ | n/a | ||
| coordinates | coordinates_id | Integer | ID of the address. | ✓ | |||
| coordinates | lng | Floating Point | Longitude | ✓ | ✓ | ||
| coordinates | lat | Floating Point | Latitude | ✓ | ✓ | ||
| coordinates | cached | Boolean | Are coordinates from geocoding cache | ✓ | 
GET
URI Mode Request URI's:
- Retrieve all the coordinate data for a particular device.
  GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/{DEVICE_ID}/coordinates
- Retrieve the latitude coordinate for a particular device's address.
  GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/{DEVICE_ID}/coordinates/lat
JSON Mode Request URI:
POST https://rest.sensaphone.net/api/v1/device/coordinates
JSON Mode Request Properties
| Parent Properties | Child Properties | Type | Description | 
| acctid | Integer | Account ID | |
| session | String | Session Token | |
| request_type | String | "read" | |
| <parent object(s)> | Array of Objects | The parent(s) of the "address" resource, if any. See the list. | |
| <parent> | coordinates | Array of Objects | The coordinates object | 
JSON Mode Response Properties
| Parent Properties | Child Property | Status | Type | Description | 
| <parent object(s)> | Optional | Array of Objects | The parent(s) specified in the request. | |
| <parent> | coordinates | Required | Array of Objects | Address data | 
| coordinates | coordinates_id | Required | Integer | ID of the address. | 
| coordinates | lng | Optional | Floating Point | Longitude | 
| coordinates | lat | Optional | Floating Point | Latitude | 
| coordinates | cached | Optional | Boolean | Are coordinates from geocoding cache | 
Example JSON
Receive coordinates for a device.
- Request JSON:
{
  "acctid": 987654,
  "sessionid": "0123-4567-8901",
  "request_type": "read",
  "device":[
  {
    "device_id": 1234,
    "coordinates": null
  }
}
- Response JSON
{
  "result":
  {
    "success": true,
    "code": 0,
    "message": "OK"
  },
  "response":
  {
    "device":[
     {
       "device_id": 1234,
       "coordinates":[
        {
          "coordinates_id": 28487,
          "lat": 39.868809,
          "lng": -75.674508
        }
       ]
     }
    ]
  }
}
PUT
URI Mode Request URI's:
- Edit the coordinates's latitude coordinate.
PUT https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/device/{DEVICE_ID}/coordinates/lat/{LATITUDE}
JSON Mode Request URI:
POST https://rest.sensaphone.net/api/v1/device/coordinates
JSON Mode Request Properties
| Parent Properties | Child Properties | Type | Description | 
| acctid | Integer | Account ID | |
| session | String | Session Token | |
| request_type | String | "read" | |
| <parent object(s)> | Array of Objects | The parent(s) of the "address" resource, if any. See the list. | |
| <parent> | coordinates | Array of Objects | The coordinates object | 
| coordinates | CHILD PROPERTY | Coordinate's child properties to be edited* | 
*One or more coordinates child properties listed below is required (other than "coordinates_id").
JSON Mode Response Properties
| Parent Properties | Child Property | Status | Type | Description | 
| <parent object(s)> | Optional | Array of Objects | The parent(s) specified in the request. | |
| <parent> | coordinates | Required | Array of Objects | Address data | 
| coordinates | coordinates_id | Required | Integer | ID of the address. | 
| coordinates | lng | Optional | Floating Point | Longitude | 
| coordinates | lat | Optional | Floating Point | Latitude | 
