Difference between revisions of "Sensaphone.net API/calllist"
(Created page with "=Sensaphone.net API= ==Specifications== A call list is a combination of contactgroups, users, Sensaphone....") |
(→POST) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
}}{{TableRowN| actions | order | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | ''' ''' | ''' ''' | '''✓''' | '''✓''' | }}{{TableRowN| actions | order | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | ''' ''' | ''' ''' | '''✓''' | '''✓''' | ||
}}{{TableRowN| actions | type | String | One of "user", "contact", or "group". | ''' ''' | ''' ''' | '''✓''' | ''' ''' | }}{{TableRowN| actions | type | String | One of "user", "contact", or "group". | ''' ''' | ''' ''' | '''✓''' | ''' ''' | ||
− | }}{{TableRowN| actions | user | Object | The | + | }}{{TableRowN| actions | user | Object | The ID of the user. 'null' for none. | '''✓''' | '''✓''' | '''✓''' | ''' ''' |
− | + | }}{{TableRowN| actions | contact | Object | The ID of the contact. 'null' for none. | '''✓''' | '''✓''' | '''✓''' | ''' ''' | |
− | }}{{TableRowN| actions | contact | Object | The contact | + | }}{{TableRowN| actions | group | Object | The ID of the group. 'null' for none. | '''✓''' | '''✓''' | '''✓''' | ''' ''' |
− | + | }}{{TableRowN| calllist | new_timeranges | Array | A special CREATE only property for call_lists under an alarm schedule | '''✓''' | ''' ''' | ''' ''' | ''' ''' | |
− | }}{{TableRowN| actions | group | Object | The group | + | |
− | }}{{TableRowN| | + | |
}}{{TableEnd}} | }}{{TableEnd}} | ||
− | |||
− | |||
− | |||
===GET=== | ===GET=== | ||
'''URI Mode Request URI's:''' | '''URI Mode Request URI's:''' | ||
Line 35: | Line 30: | ||
*Retrieve the list of tiers in a specific call list. | *Retrieve the list of tiers in a specific call list. | ||
'''GET''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers | '''GET''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers | ||
− | |||
− | |||
'''JSON Mode Request URI:''' | '''JSON Mode Request URI:''' | ||
Line 63: | Line 56: | ||
}}{{TableRowN| actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | }}{{TableRowN| actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | ||
}}{{TableRowN| actions | type | Optional | String | One of "user", "contact", or "group". | }}{{TableRowN| actions | type | Optional | String | One of "user", "contact", or "group". | ||
− | }}{{TableRowN| actions | user | Optional | Object | The | + | }}{{TableRowN| actions | user | Optional | Object | The ID of the user. 'null' for none. |
− | + | }}{{TableRowN| actions | contact | Optional | Object | The ID of the contact. 'null' for none. | |
− | }}{{TableRowN| actions | contact | Optional | Object | The | + | }}{{TableRowN| actions | group | Optional | Object | The ID of the group. 'null' for none. |
− | + | ||
− | }}{{TableRowN| actions | group | Optional | Object | The group | + | |
− | + | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
Line 107: | Line 97: | ||
"order": 1, | "order": 1, | ||
"type": "user", | "type": "user", | ||
− | "user": | + | "user": 4541 , |
"contact": null, | "contact": null, | ||
"contactgroup": null, | "contactgroup": null, | ||
Line 116: | Line 106: | ||
"type": "contact", | "type": "contact", | ||
"user": null, | "user": null, | ||
− | "contact | + | "contact": 6646, |
"contactgroup": null, | "contactgroup": null, | ||
} | } | ||
Line 128: | Line 118: | ||
===PUT=== | ===PUT=== | ||
+ | Tiers and Actions can only be updated in Json Mode | ||
+ | |||
'''URI Mode Request URI's:''' | '''URI Mode Request URI's:''' | ||
*Change the name of the call list. Setting this to anything but the blank string will make the call list a template. | *Change the name of the call list. Setting this to anything but the blank string will make the call list a template. | ||
Line 136: | Line 128: | ||
'''JSON Mode Request URI:''' | '''JSON Mode Request URI:''' | ||
'''POST''' https://rest.sesnaphone.net/api/v1/calllist/ | '''POST''' https://rest.sesnaphone.net/api/v1/calllist/ | ||
+ | |||
+ | * Move a tier to a different time | ||
+ | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device | ||
+ | { | ||
+ | "request_type" : "update", | ||
+ | "device": [ | ||
+ | { | ||
+ | "default_schedule": { | ||
+ | "calllist": [ | ||
+ | { | ||
+ | "list_id": 1234, | ||
+ | "tiers": [ | ||
+ | { | ||
+ | "tier_id": 20, | ||
+ | "minutes" : 25 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ], | ||
+ | "schedule_id": 1324 | ||
+ | }, | ||
+ | "device_id": 1234 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
'''JSON Mode Request Properties''' | '''JSON Mode Request Properties''' | ||
Line 162: | Line 179: | ||
}}{{TableRowN| actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | }}{{TableRowN| actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | ||
}}{{TableRowN| actions | type | Optional | String | One of "user", "contact", or "group". | }}{{TableRowN| actions | type | Optional | String | One of "user", "contact", or "group". | ||
− | }}{{TableRowN| actions | user | Optional | Object | The | + | }}{{TableRowN| actions | user | Optional | Object | The ID of the user. 'null' for none. |
− | + | }}{{TableRowN| actions | contact | Optional | Object | The ID of the contact. 'null' for none. | |
− | }}{{TableRowN| actions | contact | Optional | Object | The | + | }}{{TableRowN| actions | group | Optional | Object | The ID of the group. 'null' for none. |
− | + | ||
− | }}{{TableRowN| actions | group | Optional | Object | The group | + | |
− | + | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
===POST=== | ===POST=== | ||
+ | Actions can only be created in Json Mode | ||
'''URI Mode Request URI's:''' | '''URI Mode Request URI's:''' | ||
*Create a new call list. The name must be provided. | *Create a new call list. The name must be provided. | ||
'''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/name/{NAME} | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/name/{NAME} | ||
− | *Create a new | + | *Create a new tier in the call list. |
− | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/ | + | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers/minutes/{TIER_ID}/ |
'''JSON Mode Request URI:''' | '''JSON Mode Request URI:''' | ||
'''POST''' https://rest.sesnaphone.net/api/v1/calllist/ | '''POST''' https://rest.sesnaphone.net/api/v1/calllist/ | ||
+ | |||
+ | *Create an Action | ||
+ | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device/ | ||
+ | { | ||
+ | "request_type" : "create", | ||
+ | "device": [ | ||
+ | { | ||
+ | "default_schedule": { | ||
+ | "calllist": [ | ||
+ | { | ||
+ | "list_id": 1234, | ||
+ | "tiers": [ | ||
+ | { | ||
+ | "tier_id": 20, | ||
+ | "actions" : [ { | ||
+ | "user" : 12345 | ||
+ | } ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ], | ||
+ | "schedule_id": 1234 | ||
+ | }, | ||
+ | "device_id": 1234 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | |||
+ | *Link a Call List to a set of TimeRanges under an Alarm Schedule | ||
+ | '''POST''' https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device/ | ||
+ | { | ||
+ | "request_type" : "create", | ||
+ | "device": [ | ||
+ | { | ||
+ | "device_id": 1234, | ||
+ | "default_schedule": { | ||
+ | "schedule_id": 5678, | ||
+ | "calllist": [ | ||
+ | { | ||
+ | "list_id": 90123, | ||
+ | "new_timeranges": [ | ||
+ | { | ||
+ | "start": 32166000, | ||
+ | "end": 32191200, | ||
+ | "interval": 2 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | } | ||
'''JSON Mode Request Properties''' | '''JSON Mode Request Properties''' | ||
Line 202: | Line 270: | ||
}}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | }}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | ||
}}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | }}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | ||
− | }}{{TableRowN| actions | user | Object | + | }}{{TableRowN| actions | user | Object | The ID of the contact. 'null' for none. |
− | + | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
Line 226: | Line 293: | ||
}}{{TableRowN| | request_type | String | "create" | }}{{TableRowN| | request_type | String | "create" | ||
}}{{TableRowN| | calllist | Array of Objects | The call list object. | }}{{TableRowN| | calllist | Array of Objects | The call list object. | ||
− | }}{{TableRowN| calllist | list_id | + | }}{{TableRowN| calllist | list_id | Integer | ID of call list |
}}{{TableRowN| calllist | name | String | The name of the call list, or "" | }}{{TableRowN| calllist | name | String | The name of the call list, or "" | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
Line 241: | Line 308: | ||
}}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | }}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | ||
}}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | }}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | ||
− | }}{{TableRowN| actions | user | Object | + | }}{{TableRowN| actions | user | Object | The ID of the contact. 'null' for none. |
− | + | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
Line 256: | Line 322: | ||
}}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | }}{{TableRowN| tiers | tier_id | Integer | The tier number (in minutes) | ||
}}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | }}{{TableRowN| tiers | actions | Array of Objects | The actions in the call list | ||
− | }}{{TableRowN| actions | user | Object | + | }}{{TableRowN| actions | user | Object | The ID of the contact. 'null' for none. |
− | + | ||
}}{{TableEnd}} | }}{{TableEnd}} |
Latest revision as of 13:27, 9 September 2015
Contents
Sensaphone.net API
Specifications
A call list is a combination of contactgroups, users, contacts within one or more tiers (or, time waits after alarm delivery initiates). They are always contained in one or more alarm schedules. Named call lists can act as templates to be added to various call lists. An unnamed call list is considered bound to the specific alarm schedule that contains it. If a named call list is used in multiple alarm schedules, than any modification to that call list take effect in every alarm schedule that uses it.
Call Lists give users a quick and easy way to add recurring Alarm Schedules to their devices. If the same Alarm Schedule is desired to be used recurrently, Call Lists provides a means to name and save a template to be used for other devices. This will allow a user to quickly add a Call List template to the Alarm Schedule instead of adding the same Contacts, Destinations, and/or Contact Groups for every device. The structure of a Call Lists is similar to that of an Alarm Schedule with the exception that you can name and save a Call List to be used again at a later time.
The call list resource has the following properties:
Parent Property | Property | Type | Description | Create | Delete | Read | Update |
<parent> | calllist | Array of Objects | The call list object | ✓ | ✓ | ✓ | n/a |
calllist | list_id | Integer | ID of the call list. | ✓ | |||
calllist | name | String | The name of the call list, or "" | ✓ | ✓ | ||
calllist | tiers | Array | The tiers contained in this call list. | ✓ | ✓ | ||
tiers | tier_id | Integer | The tier number (in minutes) | ✓ | ✓ | ||
tiers | seqential | Boolean | 'true' if the actions in the tier are processed sequentially. | ✓ | ✓ | ||
tiers | actions | Array of Objects | The actions in the call list | ✓ | ✓ | ✓ | n/a |
actions | action_id | Integer | The ID of the action | ✓ | |||
actions | order | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. | ✓ | ✓ | ||
actions | type | String | One of "user", "contact", or "group". | ✓ | |||
actions | user | Object | The ID of the user. 'null' for none. | ✓ | ✓ | ✓ | |
actions | contact | Object | The ID of the contact. 'null' for none. | ✓ | ✓ | ✓ | |
actions | group | Object | The ID of the group. 'null' for none. | ✓ | ✓ | ✓ | |
calllist | new_timeranges | Array | A special CREATE only property for call_lists under an alarm schedule | ✓ |
GET
URI Mode Request URI's:
- Retrieve all the named call lists (those that are templates).
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/
- Retrieve the list of tiers in a specific call list.
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers
JSON Mode Request URI:
POST https://rest.sesnaphone.net/api/v1/calllist/
JSON Mode Request Properties
Parent Property | Child Property | Type | Description |
acctid | Integer | Account ID | |
session | Integer | Session ID | |
request_type | String | "read" | |
calllist | Array of Objects | The call list object. |
JSON Mode Response Properties
Parent Property | Child Property | Status | Type | Description |
calllist | Required | Array of Objects | The parent object. | |
calllist | list_id | Optional | Integer | ID of call list |
calllist | name | Optional | String | The name of the call list, or "" |
calllist | tiers | Optional | Array | The tiers contained in this call list. |
tiers | tier_id | Optional | Integer | The tier number (in minutes) |
tiers | seqential | Optional | Boolean | 'true' if the actions in the tier are processed sequentially. |
tiers | actions | Optional | Array of Objects | The actions in the call list |
actions | action_id | Optional | Integer | The ID of the action |
actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. |
actions | type | Optional | String | One of "user", "contact", or "group". |
actions | user | Optional | Object | The ID of the user. 'null' for none. |
actions | contact | Optional | Object | The ID of the contact. 'null' for none. |
actions | group | Optional | Object | The ID of the group. 'null' for none. |
Example JSON
Retrieve the information for a call list.
- Request JSON:
{ "acctid": 987654, "session": "0123-4567-8901", "request_type": "read", "calllist": [ { "list_id": 7767 } ] }
- Response JSON:
{ "result": { "success": true, "code: 0, "message": "OK", } "response": { "calllist":[ { "list_id": 7767, "name": "Primary Team", "tiers":[ { "tier_id": 3645, "sequential": false, "actions":[ { "action_id": 8222, "order": 1, "type": "user", "user": 4541 , "contact": null, "contactgroup": null, }, { "action_id": 8246, "order": 2, "type": "contact", "user": null, "contact": 6646, "contactgroup": null, } ] } ] } ] } }
PUT
Tiers and Actions can only be updated in Json Mode
URI Mode Request URI's:
- Change the name of the call list. Setting this to anything but the blank string will make the call list a template.
PUT https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/name/{NAME}
- Change a tier in the call list to a new time offset.
PUT https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers/{TIER_ID}/tier_id/{NEW_TIER_ID}
JSON Mode Request URI:
POST https://rest.sesnaphone.net/api/v1/calllist/
- Move a tier to a different time
POST https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device { "request_type" : "update", "device": [ { "default_schedule": { "calllist": [ { "list_id": 1234, "tiers": [ { "tier_id": 20, "minutes" : 25 } ] } ], "schedule_id": 1324 }, "device_id": 1234 } ] }
JSON Mode Request Properties
Parent Property | Child Property | Type | Description |
acctid | Integer | Account ID | |
session | Integer | Session ID | |
request_type | String | "update" | |
calllist | Array of Objects | The call list object. | |
calllist | list_id | Integer | ID of call list |
calllist | CHILD PROPERTY | Child properties to be edited* |
* One or more calllist child properties listed below are required in addition to "list_id".
JSON Mode Response Properties
Parent Property | Child Property | Status | Type | Description |
calllist | Required | Array of Objects | The parent object. | |
calllist | list_id | Optional | Integer | ID of call list |
calllist | name | Optional | String | The name of the call list, or "" |
calllist | tiers | Optional | Array | The tiers contained in this call list. |
tiers | tier_id | Optional | Integer | The tier number (in minutes) |
tiers | seqential | Optional | Boolean | 'true' if the actions in the tier are processed sequentially. |
tiers | actions | Optional | Array of Objects | The actions in the call list |
actions | action_id | Optional | Integer | The ID of the action |
actions | order | Optional | Integer | The order of delivery if sequential delivery is enabled. Lower numbers go first. |
actions | type | Optional | String | One of "user", "contact", or "group". |
actions | user | Optional | Object | The ID of the user. 'null' for none. |
actions | contact | Optional | Object | The ID of the contact. 'null' for none. |
actions | group | Optional | Object | The ID of the group. 'null' for none. |
POST
Actions can only be created in Json Mode URI Mode Request URI's:
- Create a new call list. The name must be provided.
POST https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/name/{NAME}
- Create a new tier in the call list.
POST https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers/minutes/{TIER_ID}/
JSON Mode Request URI:
POST https://rest.sesnaphone.net/api/v1/calllist/
- Create an Action
POST https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device/ { "request_type" : "create", "device": [ { "default_schedule": { "calllist": [ { "list_id": 1234, "tiers": [ { "tier_id": 20, "actions" : [ { "user" : 12345 } ] } ] } ], "schedule_id": 1234 }, "device_id": 1234 } ] }
- Link a Call List to a set of TimeRanges under an Alarm Schedule
POST https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/device/ { "request_type" : "create", "device": [ { "device_id": 1234, "default_schedule": { "schedule_id": 5678, "calllist": [ { "list_id": 90123, "new_timeranges": [ { "start": 32166000, "end": 32191200, "interval": 2 } ] } ] } } ] }
JSON Mode Request Properties
- Create a new call list.
Parent Property Child Property Type Description acctid Integer Account ID session Integer Session ID request_type String "create" calllist Array of Objects The call list object. calllist name String The name of the call list, or ""
- Create a new action.
Parent Property Child Property Type Description acctid Integer Account ID session Integer Session ID request_type String "create" calllist Array of Objects The call list object. calllist list_id Integer ID of call list calllist tiers Array The tiers contained in this call list. tiers tier_id Integer The tier number (in minutes) tiers actions Array of Objects The actions in the call list actions user Object The ID of the contact. 'null' for none.
DELETE
URI Mode Request URI's:
- Delete a call list. Only named call lists can be deleted.
DELETE https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}
- Delete a tier in the call list.
DELETE https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers/{TIER_ID}
- Delete a user action in the call list's tier.
DELETE https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/calllist/{LIST_ID}/tiers/{TIER_ID}/actions/{ACTION_ID}/user/{USER_ID}
JSON Mode Request URI:
POST https://rest.sesnaphone.net/api/v1/calllist/
JSON Mode Request Properties
- Delete a call list.
Parent Property Child Property Type Description acctid Integer Account ID session Integer Session ID request_type String "create" calllist Array of Objects The call list object. calllist list_id Integer ID of call list calllist name String The name of the call list, or ""
- Delete a tier.
Parent Property Child Property Type Description acctid Integer Account ID session Integer Session ID request_type String "create" calllist Array of Objects The call list object. calllist list_id Integer ID of call list calllist tiers Array The tiers contained in this call list. tiers tier_id Integer The tier number (in minutes) tiers actions Array of Objects The actions in the call list actions user Object The ID of the contact. 'null' for none.
- Delete a user action.
Parent Property Child Property Type Description acctid Integer Account ID session Integer Session ID request_type String "create" calllist Array of Objects The call list object. calllist list_id Integer ID of call list calllist tiers Array The tiers contained in this call list. tiers tier_id Integer The tier number (in minutes) tiers actions Array of Objects The actions in the call list actions user Object The ID of the contact. 'null' for none.