How to Send Data from ConnectiveOne via send_request
The send_request action allows sending any arbitrary HTTP requests from ConnectiveOne to external services. This is useful for integrating with CRM, ERP, marketing platforms, and other systems.
Differences from send_me
send_me:
- Automatically adds
chat_idandchannelto request data - Ideal for webhook integrations where chat context is needed
send_request:
- Does not automatically add
chat_idandchannel - More flexible for arbitrary API requests
- Supports Basic and Bearer authorization
Configuration
In this action configuration, specify:
url— address to send the request to, you can use{{placeholders}}method— request method (GET, POST, PUT, PATCH, DELETE)data— additional parameters to send, can contain placeholdersheaders— request headersbasic_auth— data for Basic authorization (optional)bearer_auth— token for Bearer authorization (optional)
Possible Branching by Events
"ok"— request successfully executed"not_ok"— error during request execution
Configuration Examples
Example 1: Simple POST Request
{
"url": "https://your-service.com/api/webhook",
"method": "POST",
"data": {
"data_source": "ConnectiveOne",
"client_id": "{{messenger_input_param}}"
},
"headers": {
"Content-Type": "application/json",
"X-Custom-Header": "MyValue"
}
}
Example 2: GET Request with Parameters
{
"url": "https://api.example.com/users?name={{user_name}}&email={{user_email}}",
"method": "GET",
"headers": {
"Content-Type": "application/json"
}
}
Example 3: POST Request with Basic Authorization
{
"url": "https://api.example.com/secure",
"method": "POST",
"data": {
"message": "{{user_message}}"
},
"basic_auth": {
"login": "username",
"pass": "password"
}
}
Example 4: POST Request with Bearer Token
{
"url": "https://api.example.com/data",
"method": "POST",
"data": {
"action": "update",
"value": "{{some_value}}"
},
"bearer_auth": {
"token": "{{api_token}}"
},
"headers": {
"Content-Type": "application/json"
}
}
Error Handling
If the request ended with an error, the action returns "not_ok". In the scenario, you can handle this event for:
- Retry
- Sending a message to the user
- Logging the error
- Transferring to operator
Limitations
- URL must be accessible from the ConnectiveOne server
- Only HTTP and HTTPS protocols are supported
- Request timeout depends on system settings
- Maximum data size is limited by system settings