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

From Sensaphone.net
Jump to: navigation, search
(Created page with "=Sensaphone.net API= ==Specifications== The account resource The account resource has the following properties: {{TableStart|border_size=1 }}{{TableRowN| '''Parent Proper...")
 
(GET)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=[[Sensaphone.net API]]=
 
=[[Sensaphone.net API]]=
 
==Specifications==
 
==Specifications==
The account resource
+
The feature resource
  
The account resource has the following properties:
+
The feature resource has the following properties:
 
{{TableStart|border_size=1
 
{{TableStart|border_size=1
 
}}{{TableRowN| '''Parent Property'''|'''Property'''  | '''Type'''    | '''Description'''        | '''Create''' | '''Delete''' | '''Read''' | '''Update'''
 
}}{{TableRowN| '''Parent Property'''|'''Property'''  | '''Type'''    | '''Description'''        | '''Create''' | '''Delete''' | '''Read''' | '''Update'''
}}{{TableRowN| ''<parent>''         | account    | Object        | The account object.  | ''' ''' | ''' ''' | '''&#x2713;''' | '''n/a'''
+
}}{{TableRowN| ''<parent>''           | feature             | Array of Object | The feature linked to the account/device               | ''' ''' | ''' ''' | '''&#x2713;''' | '''&#x2713;'''
}}{{TableRowN| account          | name             | String |  The name of the account              | ''' ''' | ''' ''' | '''&#x2713;''' | '''&#x2713;'''
+
}}{{TableRowN| account          | timezone              | String | The timezone which the account is in                | ''' ''' | ''' ''' | '''&#x2713;''' | '''&#x2713;'''
+
}}{{TableRowN| account          | feature              | Object | The feature linked to the account              | ''' ''' | ''' ''' | '''&#x2713;''' | '''&#x2713;'''
+
 
}}{{TableRowN| feature          | feature_id              | Integer | The ID of the feature              | ''' ''' | ''' ''' | '''&#x2713;''' |  ''' '''
 
}}{{TableRowN| feature          | feature_id              | Integer | The ID of the feature              | ''' ''' | ''' ''' | '''&#x2713;''' |  ''' '''
 
}}{{TableRowN| feature          | resource              | String | The resource of the feature              | ''' ''' | ''' ''' | '''&#x2713;''' |  ''' '''
 
}}{{TableRowN| feature          | resource              | String | The resource of the feature              | ''' ''' | ''' ''' | '''&#x2713;''' |  ''' '''
Line 21: Line 18:
 
===GET===
 
===GET===
 
'''URI Mode Request URI's:'''
 
'''URI Mode Request URI's:'''
*Retrieve all the account data
+
*Retrieve all the account features
   '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account
+
   '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account/feature
  
*Retrieve the account name
+
*Retrieve all the device features
   '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account/name
+
   '''GET''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/feature
  
 
'''JSON Mode Request URI:'''
 
'''JSON Mode Request URI:'''
   '''POST''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/account
+
   '''POST''' <nowiki>https://</nowiki>rest.sensaphone.net/api/v1/account/feature
  
 
'''JSON Mode Request Properties'''
 
'''JSON Mode Request Properties'''
Line 36: Line 33:
 
}}{{TableRowN| &nbsp;                  | session                | Integer          | Session ID
 
}}{{TableRowN| &nbsp;                  | session                | Integer          | Session ID
 
}}{{TableRowN| &nbsp;                  | request_type          | String          | "read"
 
}}{{TableRowN| &nbsp;                  | request_type          | String          | "read"
}}{{TableRowN| ''<parent>''            | account           | Array of Objects | The accounts object
+
}}{{TableRowN| ''<parent>''            | feature           | Array of Objects | The features object
 
}}{{TableEnd}}
 
}}{{TableEnd}}
  
Line 43: Line 40:
 
}}{{TableRowN| '''Parent Properties'''  | '''Child Property'''    | '''Status''' | '''Type'''      | '''Description'''
 
}}{{TableRowN| '''Parent Properties'''  | '''Child Property'''    | '''Status''' | '''Type'''      | '''Description'''
 
}}{{TableRowN| &nbsp;                    | ''<parent object(s)>''  | Optional    | Array of Objects | The parent(s) specified in the request.
 
}}{{TableRowN| &nbsp;                    | ''<parent object(s)>''  | Optional    | Array of Objects | The parent(s) specified in the request.
}}{{TableRowN| ''<parent>''             | account             | Required     | Array of Objects | Account Data
+
}}{{TableRowN| ''<parent>''           | feature             | Required      | Object | The feature linked to the account/device              
}}{{TableRowN| account          | name              | Optional      | String | The name of the account
+
}}{{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          | feature_id          | Required          | Integer | The ID of the feature             
 
}}{{TableRowN| feature          | resource            | Optional        | String | The resource of the feature             
 
}}{{TableRowN| feature          | resource            | Optional        | String | The resource of the feature             
Line 57: Line 51:
  
 
====Example JSON====
 
====Example JSON====
Receive coordinates for a device.
+
Receive all the account features' option
  
 
*'''Request JSON:'''
 
*'''Request JSON:'''
Line 64: Line 58:
 
   "sessionid": "0123-4567-8901",
 
   "sessionid": "0123-4567-8901",
 
   "request_type": "read",
 
   "request_type": "read",
   "account": null
+
   "account": [
 +
      {
 +
          "option" : null
 +
      }
 +
  ]
 
  }
 
  }
  
Line 79: Line 77:
 
     "account": [
 
     "account": [
 
     {
 
     {
         "name":"Tim's Awesome Account",
+
         "feature": [
        "timezone":"Central Time"
+
            {
 +
                "feature_id" : 1234,
 +
                "option" : "Premium"
 +
            }
 +
        ]
 
     }]
 
     }]
 
   }
 
   }
Line 87: Line 89:
 
===PUT===
 
===PUT===
 
'''URI Mode Request URI's:'''
 
'''URI Mode Request URI's:'''
*Edit the account's name.
+
*Change an account feature
   '''PUT''' https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/account/{NAME}
+
   '''PUT''' https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/account/feature/option/{NEW_OPTION}
  
 
'''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/feature
 +
   '''POST''' https://rest.sensaphone.net/api/v1/device/feature
  
 
'''JSON Mode Request Properties'''
 
'''JSON Mode Request Properties'''
Line 99: Line 102:
 
}}{{TableRowN| &nbsp;                  | session                | Integer          | Session ID
 
}}{{TableRowN| &nbsp;                  | session                | Integer          | Session ID
 
}}{{TableRowN| &nbsp;                  | request_type          | String          | "read"
 
}}{{TableRowN| &nbsp;                  | request_type          | String          | "read"
}}{{TableRowN| ''<parent>''            | account           | Array of Objects | The accounts object
+
}}{{TableRowN| ''<parent>''            | feature           | Array of Objects | The feature object
}}{{TableRowN| account             | '''''CHILD PROPERTY''''' | &nbsp;          | Account's child properties to be edited*
+
}}{{TableRowN| feature             | '''''CHILD PROPERTY''''' | &nbsp;          | Feature's child properties to be edited*
 
}}{{TableEnd}}
 
}}{{TableEnd}}
<nowiki>*</nowiki>One or more '''account''' child properties listed below is required
 
  
 
'''JSON Mode Response Properties'''
 
'''JSON Mode Response Properties'''
Line 108: Line 110:
 
}}{{TableRowN| '''Parent Properties'''  | '''Child Property'''    | '''Status''' | '''Type'''      | '''Description'''
 
}}{{TableRowN| '''Parent Properties'''  | '''Child Property'''    | '''Status''' | '''Type'''      | '''Description'''
 
}}{{TableRowN| &nbsp;                    | ''<parent object(s)>''  | Optional    | Array of Objects | The parent(s) specified in the request.
 
}}{{TableRowN| &nbsp;                    | ''<parent object(s)>''  | Optional    | Array of Objects | The parent(s) specified in the request.
}}{{TableRowN| ''<parent>''             | account            | Required    | Array of Objects | Account Data
+
}}{{TableRowN| ''<parent>''       | feature            | Optional      | Object | The feature linked to the account/device              
}}{{TableRowN| account          | name              | Optional      | String | The name of the account
+
}}{{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          | feature_id          | Required          | Integer | The ID of the feature                     
 
}}{{TableRowN| feature          | option          | Optional          | String | The value of the feature     
 
}}{{TableRowN| feature          | option          | Optional          | String | The value of the feature     
 
}}{{TableEnd}}
 
}}{{TableEnd}}

Latest revision as of 10:02, 28 May 2015

Sensaphone.net API

Specifications

The feature resource

The feature resource has the following properties:

Parent PropertyProperty Type Description Create Delete Read Update
<parent> feature Array of Object The feature linked to the account/device
feature feature_id Integer The ID of the feature
feature resource String The resource of the feature
feature description String The description of the feature
feature resource_id Integer The ID of the resource
feature parent_ids Array of Integers The IDs of the parent features
feature option String The value of the feature
feature is_hidden Boolean Is the feature hidden

GET

URI Mode Request URI's:

  • Retrieve all the account features
  GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/account/feature
  • Retrieve all the device features
  GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/device/feature

JSON Mode Request URI:

  POST https://rest.sensaphone.net/api/v1/account/feature

JSON Mode Request Properties

Parent Properties Child Properties Type Description
  acctid Integer Account ID
  session Integer Session ID
  request_type String "read"
<parent> feature Array of Objects The features 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> feature Required Object The feature linked to the account/device
feature feature_id Required Integer The ID of the feature
feature resource Optional String The resource of the feature
feature description Optional String The description of the feature
feature resource_id Optional Integer The ID of the resource
feature parent_ids Optional Array of Integers The IDs of the parent features
feature option Optional String The value of the feature
feature is_hidden Optional Boolean Is the feature hidden

Example JSON

Receive all the account features' option

  • Request JSON:
{
  "acctid": 987654,
  "sessionid": "0123-4567-8901",
  "request_type": "read",
  "account": [
     {
          "option" : null
     }
  ]
}
  • Response JSON
{
  "result":
  {
    "success": true,
    "code": 0,
    "message": "OK"
  },
  "response":
  {
    "account": [
    {
       "feature": [
           {
               "feature_id" : 1234,
               "option" : "Premium"
           }
        ]
    }]
  }
}

PUT

URI Mode Request URI's:

  • Change an account feature
  PUT https://rest.sensaphone.net/api/v1/{ACCTID}/{SEESIONID}/account/feature/option/{NEW_OPTION}

JSON Mode Request URI:

  POST https://rest.sensaphone.net/api/v1/account/feature
  POST https://rest.sensaphone.net/api/v1/device/feature

JSON Mode Request Properties

Parent Properties Child Properties Type Description
  acctid Integer Account ID
  session Integer Session ID
  request_type String "read"
<parent> feature Array of Objects The feature object
feature CHILD PROPERTY   Feature's child properties to be edited*

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> feature Optional Object The feature linked to the account/device
feature feature_id Required Integer The ID of the feature
feature option Optional String The value of the feature