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

From Sensaphone.net
Jump to: navigation, search
m (Example JSON)
(Sensaphone.net API: Update Session data type.)
 
Line 22: Line 22:
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN|            | acctid                  | Integer          | Account ID
 
}}{{TableRowN|            | acctid                  | Integer          | Account ID
}}{{TableRowN|            | session                  | Integer          | Session ID
+
}}{{TableRowN|            | session                  | String          | Session Token
 
}}{{TableRowN|            | request_type            | String          | "read"
 
}}{{TableRowN|            | request_type            | String          | "read"
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].
Line 107: Line 107:
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN| &nbsp;          | acctid                  | Integer          | Account ID
 
}}{{TableRowN| &nbsp;          | acctid                  | Integer          | Account ID
}}{{TableRowN| &nbsp;          | session                  | Integer          | Session ID
+
}}{{TableRowN| &nbsp;          | session                  | String          | Session Token
 
}}{{TableRowN| &nbsp;          | request_type            | String          | "read"
 
}}{{TableRowN| &nbsp;          | request_type            | String          | "read"
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].
Line 135: Line 135:
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''
 
}}{{TableRowN| &nbsp;          | acctid                  | Integer          | Account ID
 
}}{{TableRowN| &nbsp;          | acctid                  | Integer          | Account ID
}}{{TableRowN| &nbsp;          | session                  | Integer          | Session ID
+
}}{{TableRowN| &nbsp;          | session                  | String          | Session Token
 
}}{{TableRowN| &nbsp;          | request_type            | String          | "read"
 
}}{{TableRowN| &nbsp;          | request_type            | String          | "read"
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].
 
}}{{TableRowN| &nbsp;          | ''<parent object(s)>''  | Array of Objects | The parent(s) of the "schedule" resource, if any. See the [[Sensaphone.net_API#List|'''list''']].

Latest revision as of 11:41, 10 July 2025

Sensaphone.net API

Specifications

The schedule resource has the following properties:

Parent PropertyProperty Type Description Create Delete Read Update
<parent> schedule Object The schedule object. n/a
schedule schedule_id Integer ID of the schedule.
schedule timerange Array of Objects The schedule's time ranges


GET

URI Mode Request URI's:

  • Retrieve all information for a schedule.
  GET https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/user/{USER_ID}/contact/{CONTACT_ID}/schedule

JSON Mode Request URI:

  POST https://rest.sensaphone.net/api/v1/user/contact/schedule

JSON Mode Request Properties

Parent PropertyChild PropertyType Description
  acctid Integer Account ID
  session String Session Token
  request_type String "read"
  <parent object(s)> Array of Objects The parent(s) of the "schedule" resource, if any. See the list.
<parent> schedule Array of Objects The schedule object

JSON Mode Response Properties

Parent PropertyChild PropertyStatus Type Description
  <parent object(s)> Optional Array of Objects The parent(s) specified in the request.
<parent> schedule Required Array of Objects The schedule object
schedule schedule_id Optional Integer ID for schedule
schedule timerange Optional Array of Objects (See Sensaphone.net API/timerange)

Example JSON

Retrieve schedule information.

  • Request JSON
  {
    "acctid": 987654,
    "session": "0123-4567-8901",
    "request_type": "read",
    "device":[
     {
       "device_id": 1234,
       "default_schedule":[
        {
          "schedule_id":28487
        }
       ]
     }
    ]
  }
  • Response JSON
{
  "result":
  {
    "success": true,
    "code": 0,
    "message": "OK"
  },
  "response":
  {
    "device":[
     {
       "device_id": 1234,
       "default_schedule":[
        {
          "schedule_id":28487,
          "timerange":[
            {
              "range_id": 58381
              "start": "..TBD..",
              "end": "..TBD..",
              "interval": 127
            },
            {
              "range_id": 51587
              "start": "..TBD..",
              "end": "..TBD..",
              "interval": 7
            }
          ]
        }
       ]
     }
    ]
  }
}

POST

URI Mode Request URI's:

  • Create a new (default) schedule.
  POST https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/user/{USER_ID}/contact/{CONTACT_ID}/schedule

JSON Mode Request URI:

  POST https://rest.sensaphone.net/api/v1/user/contact/schedule

JSON Mode Request Properties

Parent PropertyChild PropertyType Description
  acctid Integer Account ID
  session String Session Token
  request_type String "read"
  <parent object(s)> Array of Objects The parent(s) of the "schedule" resource, if any. See the list.
<parent> schedule Array of Objects The schedule object
schedule timerange Array of Objects Optional (See Sensaphone.net API/timerange)

JSON Mode Response Properties

Parent PropertyChild PropertyStatus Type Description
  <parent object(s)> Optional Array of Objects The parent(s) specified in the request.
<parent> schedule Required Array of Objects The schedule object
schedule schedule_id Optional Integer ID for schedule
schedule timerange Optional Array of Objects (See Sensaphone.net API/timerange)

DELETE

URI Mode Request URI's:

  • Delete an existing schedule. This may make it go away or reset it to default values, depending on the context.
  DELETE https://rest.sensaphone.net/api/v1/{ACCTID}/{SESSIONID}/user/{USER_ID}/contact/{CONTACT_ID}/schedule/{SCHEDULE_ID}

JSON Mode Request URI:

  POST https://rest.sensaphone.net/api/v1/user/contact/schedule

JSON Mode Request Properties

Parent PropertyChild PropertyType Description
  acctid Integer Account ID
  session String Session Token
  request_type String "read"
  <parent object(s)> Array of Objects The parent(s) of the "schedule" resource, if any. See the list.
<parent> schedule Array of Objects The schedule object
schedule schedule_id Integer The ID of the schedule