Sensaphone.net API/account
From Sensaphone.net
Revision as of 14:10, 29 April 2015 by Tim (Talk | contribs) (Created page with "=Sensaphone.net API= ==Specifications== The account resource The account resource has the following properties: {{TableStart|border_size=1 }}{{TableRowN| '''Parent Proper...")
Sensaphone.net API
Specifications
The account resource
The account resource has the following properties:
Parent Property | Property | Type | Description | Create | Delete | Read | Update |
<parent> | account | Object | The account object. | ✓ | n/a | ||
account | name | String | The name of the account | ✓ | ✓ | ||
account | timezone | String | The timezone which the account is in | ✓ | ✓ |
GET
URI Mode Request URI's:
- Retrieve all the account data
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account
- Retrieve the account name
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account/name
JSON Mode Request URI:
POST https://rest.sensaphone.net/api/v1/account
JSON Mode Request Properties
Parent Properties | Child Properties | Type | Description |
acctid | Integer | Account ID | |
session | Integer | Session ID | |
request_type | String | "read" | |
<parent> | account | Array of Objects | The accounts 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> | account | Required | Array of Objects | Account Data |
account | name | Optional | String | The name of the account |
account | timezone | Optional | String | The timezone which the account is in |
Example JSON
Receive coordinates for a device.
- Request JSON:
{ "acctid": 987654, "sessionid": "0123-4567-8901", "request_type": "read", "account": null }
- Response JSON
{ "result": { "success": true, "code": 0, "message": "OK" }, "response": { "account": [ { "name":"Tim's Awesome Account", "timezone":"Central Time" }] } }
PUT
URI Mode Request URI's:
- Edit the account's name.
PUT https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/account/{NAME}
JSON Mode Request URI:
POST https://rest.sensaphone.net/api/v1/device/account
JSON Mode Request Properties
Parent Properties | Child Properties | Type | Description |
acctid | Integer | Account ID | |
session | Integer | Session ID | |
request_type | String | "read" | |
<parent> | account | Array of Objects | The accounts object |
account | CHILD PROPERTY | Account's child properties to be edited* |
*One or more account child properties listed below is required
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> | account | Required | Array of Objects | Account Data |
account | name | Optional | String | The name of the account |
account | timezone | Optional | String | The timezone which the account is in |