* Validation error text may vary depending on a source of an error
Description
This method is for sending message with a contact info.
If a service specify value of localID variable, it would get MessageIdAssigned update asynchronously.
On succes empty response with http code 200 is returned.
Endpoint
https://messapi.btsdapps.net/bot/v1/updates/
Structure
Variable | Obligative | Type | Validation | Description |
---|---|---|---|---|
type | true | String | Must be filled with “SendContactMessage” value | Type of request “SendContactMessage” |
localId | false | String | LocalID length should be <= 255 | Message ID generated by Bot |
recipient | true | Peer | For Peer type validation see type page | Peer to send this message to |
inputMedia | true | InputContact | - | InputContact object containing contact info |
Sample request
{
"commands":[
{
"type":"SendContactMessage",
"localId":"54353",
"recipient":{
"type":"GROUP",
"id":"Uuid_value"
},
"inputMedia":{
"firstName":"Alexandr",
"lastName":"",
"phoneNumber":"7**********",
"contactType":"InputUnregisteredContact"
}
}
]
}
Updates
This method may asynchronously return following updates:
Possible business exceptions
Service to service dialog
Sending contact messages from service to service is not available, function is not supported.
Service to user dialog
- Sending contact message to a user who banned a service ( put a service into a black list) is not available;
- Sending contact message to a user is not available if a dialog wasn't found (deleted/ID error);
- Sending contact message to a user is not available if Peer type and Peer ID specified in request doesn't match;
Service to channel dialog
- Sending contact message to a channel is not available if a channel wasn't found (deleted/ID error) or channel was banned;
- Sending contact message to a channel is not available if a service is not a channel subscriber and has no administrator/owner role assigned with permission to write;
Service to group dialog
Sending contact message to a group dialog is not available if a service is not a member of this group.