Difference between revisions of "Sensaphone.net API/account"

From Sensaphone.net
Jump to: navigation, search
(Sensaphone.net API)
(Sensaphone.net API)
 
(8 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
}}{{TableRowN| account          | name              | String |  The name of the account              | ''' ''' | ''' ''' | '''✓''' | '''✓'''
 
}}{{TableRowN| account          | name              | String |  The name of the account              | ''' ''' | ''' ''' | '''✓''' | '''✓'''
 
}}{{TableRowN| account          | timezone              | String | The timezone which the account is in                | ''' ''' | ''' ''' | '''✓''' | '''✓'''
 
}}{{TableRowN| account          | timezone              | String | The timezone which the account is in                | ''' ''' | ''' ''' | '''✓''' | '''✓'''
}}{{TableRowN| account          | feature              | Object | The feature linked to the account               | ''' ''' | ''' ''' | '''✓''' | '''✓'''
+
}}{{TableRowN| account          | feature              | Array of Object | The feature linked to the account (See [[Sensaphone.net API/feature]])              | ''' ''' | ''' ''' | '''✓''' | '''✓'''
 
}}{{TableEnd}}
 
}}{{TableEnd}}
  
Line 39: Line 39:
 
}}{{TableRowN| account          | name              | Optional      | String | The name of the account  
 
}}{{TableRowN| account          | name              | Optional      | String | The name of the account  
 
}}{{TableRowN| account          | timezone              | Optional      | String | The timezone which the account is in   
 
}}{{TableRowN| account          | timezone              | Optional      | String | The timezone which the account is in   
}}{{TableRowN| account          | feature            | Optional      | Object | The feature linked to the account            
+
}}{{TableRowN| account          | feature            | Optional      | Array of Objects | The feature linked to the account (See [[Sensaphone.net API/feature]])          
}}{{TableRowN| feature         | feature_id          | Required          | Integer | The ID of the feature           
+
}}{{TableRowN| feature          | resource            | Optional        | String | The resource of the feature           
+
}}{{TableRowN| feature          | description         | Optional          | String | The description of the feature           
+
}}{{TableRowN| feature          | resource_id        | Optional            | Integer | The ID of the resource           
+
}}{{TableRowN| feature          | parent_ids          | Optional          | Array of Integers | The IDs of the parent features         
+
}}{{TableRowN| feature          | option          | Optional          | String | The value of the feature           
+
}}{{TableRowN| feature          | is_hidden          | Optional          | Boolean |  Is the feature hidden           
+
 
}}{{TableEnd}}
 
}}{{TableEnd}}
  
 
====Example JSON====
 
====Example JSON====
Receive coordinates for a device.
+
Receive the account name and timezone
  
 
*'''Request JSON:'''
 
*'''Request JSON:'''
Line 57: Line 50:
 
   "sessionid": "0123-4567-8901",
 
   "sessionid": "0123-4567-8901",
 
   "request_type": "read",
 
   "request_type": "read",
   "account": null
+
   "account": [
 +
      {
 +
          "name" : null,
 +
          "timezone" : null
 +
      }
 +
  ]
 
  }
 
  }
  
Line 72: Line 70:
 
     "account": [
 
     "account": [
 
     {
 
     {
         "name":"Tim's Awesome Account",
+
         "name":"John's Account",
 
         "timezone":"Central Time"
 
         "timezone":"Central Time"
 
     }]
 
     }]
Line 84: Line 82:
  
 
'''JSON Mode Request URI:'''
 
'''JSON Mode Request URI:'''
   '''POST''' https://rest.sensaphone.net/api/v1/device/account
+
   '''POST''' https://rest.sensaphone.net/api/v1/account
  
 
'''JSON Mode Request Properties'''
 
'''JSON Mode Request Properties'''
Line 104: Line 102:
 
}}{{TableRowN| account          | name              | Optional      | String | The name of the account  
 
}}{{TableRowN| account          | name              | Optional      | String | The name of the account  
 
}}{{TableRowN| account          | timezone              | Optional      | String | The timezone which the account is in   
 
}}{{TableRowN| account          | timezone              | Optional      | String | The timezone which the account is in   
}}{{TableRowN| account          | feature            | Optional      | Object | The feature linked to the account             
 
}}{{TableRowN| feature          | feature_id          | Required          | Integer | The ID of the feature                   
 
}}{{TableRowN| feature          | option          | Optional          | String | The value of the feature   
 
 
}}{{TableEnd}}
 
}}{{TableEnd}}

Latest revision as of 10:07, 28 May 2015

Sensaphone.net API

Specifications

The account resource

The account resource has the following properties:

Parent PropertyProperty 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
account feature Array of Object The feature linked to the account (See Sensaphone.net API/feature)

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
account feature Optional Array of Objects The feature linked to the account (See Sensaphone.net API/feature)

Example JSON

Receive the account name and timezone

  • Request JSON:
{
  "acctid": 987654,
  "sessionid": "0123-4567-8901",
  "request_type": "read",
  "account": [
     {
         "name" : null,
         "timezone" : null
     }
  ]
}
  • Response JSON
{
  "result":
  {
    "success": true,
    "code": 0,
    "message": "OK"
  },
  "response":
  {
    "account": [
    {
       "name":"John's 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/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