Create Contact Entity
You can create contacts with the next types:
regular
- for monitors, intercom SIP numbers, etc.individual
- for individual panelsmulti
- for multiapartment panels
Contact number can take two formats:
inner protocol
SIP
For inner protocol
contact numbers with different type must match different pattern:
regular
like [builing]-[unit]-[floor]-[apartment], for example '0001-01-11-11'individual
like [builing]-[unit]-[floor]-[apartment]-[device number], for example '001-01-11-11-1'multi
like [builing]-[unit]-[device number], for example '0001-01-01'
regular | idividual | multi | |
---|---|---|---|
building | 0001 - 9999 | 001 - 999 | 0001 - 9999 |
unit | 00 - 99 | 00 - 99 | 00 - 99 |
floor | 00 - 98 | 00 - 98 | |
apartment | 00 - 99 | 00 - 99 | |
device | 1 - 9 | 01 - 99 |
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 receive all calls from some numbers without sound, you can add it to the blacklist using the in_black_list property. The call will be displayed in the Records.
If you want the device to immediately receive a call from the specified number use property auto_answer
.
Two parameters: auto_answer
and in_black_list
cannot be true
at the same time.
Maximum number of contacts - 300
- application/json
Request Body required
- name string required
Possible values:
non-empty
and<= 30 characters
- type string required
Possible values: [
regular
,individual
,multi
] - number string required
There is two format: inner number and SIP number
Inner number for differen devices:
regular
like [builing]-[unit]-[floor]-[apartment], for example '0001-01-11-11'individual
like [builing]-[unit]-[floor]-[apartment]-[device number], for example '001-01-11-11-1'multi
like [builing]-[unit]-[device number], for example '0001-01-01'
regular idividual multi building 0001 - 9999 001 - 999 0001 - 9999 unit 00 - 99 00 - 99 00 - 99 floor 00 - 98 00 - 98 apartment 00 - 99 00 - 99 device 1 - 9 01 - 99 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
- auto_answer boolean required
If true device will answer immediatelly 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/PUT/DELETE /contacts/{entityUid}
- to get info about contact, update or delete it
- application/json
- Schema
- Example (from schema)
- Example
Schema
- uid integer
UID for entities referenses
{
"uid": 3
}
{
"uid": 3
}
- Invalid name
- Invalid type
- Invalid number
- You cannot add more than 300 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
"error": "Two parameters: auto_answer and in_black_list cannot be true at the same time"
- application/json
- Schema
- Example (from schema)
- Base
- No value
- Wrong param type
- Contact already exists
- Invalid name
- Invalid type
- Invalid number
- Cannot create new contact
Schema
- error string
{
"error": "Wrong JSON body"
}
{
"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": "You cannot add more than 300 contacts"
}
Unauthorized request. Log In