Create Contact Entity
You can create contacts with the next types:
regular
- for monitors, intercom SIP numbers, etc.individual
- for individual panelsmulti
- for multiapartment panelsglobal
- for panels on wall (device number from 1 to 9000)
Contact number can take two formats:
inner protocol
SIP
For inner protocol
contact numbers with different type must match different pattern:
regular
regex is^\d{3}[1-9]-\d{2}-\d[0-8]-\d{2}$
, like [building]-[unit]-[floor]-[apartment], for example '0001-01-11-11'individual
regex is^\d{2}[1-9]-\d{2}-\d[0-8]-\d{2}-[1-9]$
, like [building]-[unit]-[floor]-[apartment]-[device number], for example '001-01-11-11-1'multi
regex is^\d{3}[1-9]-\d{2}-\d[1-9]$
, like [building]-[unit]-[device number], for example '0001-01-01'global
regex is^\d{3}[1-9]$
, like [device] from 1 to 9000, for example '0001'
In general, building must be in range [1-999] for individual panel and [1-9999] - for other devices, unit: [00-99], floor: [00-98] (99 is reserved for multi- panel), apartment: [00-99], device: [0-8]
For SIP
contact numbers regex is sip:[0-9A-Za-z+\-_.]+@((((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?(?:\:\d{1,5})?)(\.|$)){4}\b)|([0-9]*[A-Za-z+\-_]+[0-9]*)(\.([0-9]*[A-Za-z+\-_]+[0-9]*))+)
, for example sip:[email protected]
or sip:[email protected]
If you want the device to skip all calls from some numbers you can add it to black list, using property in_black_list
. Call will be added to recent calls with proper icon.
If you want the device to immediately receive a call from the specified number use property auto_answer
. If auto_answer
it true then in_black_list
will be set to false.
Two parameters: auto_answer
and in_black_list
cannot be true
at the same time.
is_default
parameter can be true
only for panel-like contacts. Default panel will be played when panel viewer app will be opened. Only one contact on the device can be default panel.
Maximum number of contacts - 1000
- application/json
Request Body required
- name string required
Contact name
- type string required
Possible values: [
regular
,individual
,multi
,global
]Contact type
- number string required
Contact number.
There is two format: inner number and SIP number
Inner number regexes for different devices:
- ^\d{3}[1-9]-\d{2}-\d[0-8]-\d{2}$ - for regular device - monitor
- ^\d{3}[1-9]-\d{2}-\d[1-9]$ - for multiapartment panel
- ^\d{2}[1-9]-\d{2}-\d[0-8]-\d{2}-[1-9]$ - for individual panel
- ^\d{3}[1-9]$ - for global panel
SIP number format: sip:[0-9A-Za-z+-.]+@((((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?(?::\d{1,5})?)(.|$)){4}\b)|([0-9]*[A-Za-z+-]+[0-9])(.([0-9][A-Za-z+-_]+[0-9]*))+), for example
sip:[email protected]
orsip:[email protected]
- is_favorite boolean required
Favorite contacts will be displayed at the top of the list
- is_default boolean required
This flag can be true only for panel-like contacts. Default panel will be played when panel viewer app will be opened
- auto_answer boolean required
If true device will answer immediately when received call from this contact.
auto_answer
andin_black_list
cannot be true at the same time - in_black_list boolean required
If true device will skip incoming call from this contact.
auto_answer
andin_black_list
cannot be true at the same time
- 200
- 400
- 401
The uid
value returned in the response can be used as the entityUid
parameter in next requests:
GET/PATCH/DELETE /contact/item/{entityUid}
- to get information about contact, update or delete it
- application/json
- Schema
- Example (from schema)
- Example
Schema
- uid integer
UID for entities references
{
"uid": 3
}
{
"uid": 3
}
- Invalid name
- Invalid type
- Invalid number
- Two parameters: auto_answer and in_black_list cannot be true at the same time
- A contact already exists with the same type and number
- You cannot add more than 10000 contacts
- Validation error. Required fields are not provided.
- Missed json body or wrong param. Response sample:
"error": "Wrong JSON body"
- Required field is not provided. Response sample:
"error": "Wrong JSON body: no value for `param`"
where param
- is a required field that was not provided
- Field was of the wrong type. Response sample:
"error": "Wrong JSON body: value `param` was of the wrong type"
where param
- is a field of the wrong type
- application/json
- Schema
- Example (from schema)
- Base
- No value
- Wrong param type
- Contact already exists
- Invalid name
- Invalid type
- Invalid number
- Invalid contact
- Cannot create new contact
- Contact exists
Schema
- error string
Error information
{
"error": true
}
{
"error": "Wrong JSON body"
}
{
"error": "Wrong JSON body: no value for `param`"
}
{
"error": "Wrong JSON body: value `param` was of the wrong type"
}
{
"error": "Contact with that type and number already exist"
}
{
"error": "Invalid name"
}
{
"error": "Invalid type"
}
{
"error": "Invalid number"
}
{
"error": "Two parameters: auto_answer and in_black_list cannot be true at the same time"
}
{
"error": "You cannot add more than 10000 contacts"
}
{
"error": "A contact already exists with the same type and number"
}
Unauthorized request. Log In
- application/json
- Schema
- Example (from schema)
- Log In
Schema
- error string
Error information
{
"error": "Log In"
}
{
"error": "Log In"
}