Sensaphone.net API/schedule

From Sensaphone.net
Jump to: navigation, search

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 Integer Session ID
  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 Integer Session ID
  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 Integer Session ID
  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