Send RCS message
Example of request to send RCS message message with a text, image and a button which, when clicked, will lead to the specified link.
URI: https://api.interconnect.solutions/api/json.php
All requests to API are sent in JSON format using the POST method.
Header parameters
Requests must contain header Content-Type: application/json, otherwise, the request will be considered invalid even if it has valid JSON.
Request parameters
Request example
- Sync
- Async
- JSON
- cURL
- PHP
- Python
- Node.js
{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
}
curl -X POST 'https://api.interconnect.solutions/api/json.php' \
-H 'Content-Type: application/json' \
--data-raw '{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
}'
<?php
$payload = json_encode([
'auth' => 'bb56a4369eb19***cfec6d1776bd25',
'data' => [
[
'type' => 'rcs',
'id' => 100500,
'phone' => 380971234567,
'rcs_signature' => 'RCSTest',
'rcs_message' => 'Message text to be sent via RCS',
'rcs_image' => 'https://url.com/storage/images/image.png',
'rcs_link' => 'https://redirect.url',
'rcs_button' => 'Button caption',
'rcs_lifetime' => 172800,
'short_link' => true,
'hook' => 'https://example.org/webhook/url.php',
],
],
], JSON_UNESCAPED_UNICODE);
$ch = curl_init('https://api.interconnect.solutions/api/json.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": True,
"hook": "https://example.org/webhook/url.php",
},
],
}
response = requests.post(
"https://api.interconnect.solutions/api/json.php",
json=payload,
timeout=30,
)
print(response.json())
const payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
};
const response = await fetch("https://api.interconnect.solutions/api/json.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
console.log(await response.json());
- JSON
- cURL
- PHP
- Python
- Node.js
{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
}
curl -X POST 'https://api-async.interconnect.solutions/v1/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
}'
<?php
$payload = json_encode([
'auth' => 'bb56a4369eb19***cfec6d1776bd25',
'data' => [
[
'type' => 'rcs',
'id' => 100500,
'phone' => 380971234567,
'rcs_signature' => 'RCSTest',
'rcs_message' => 'Message text to be sent via RCS',
'rcs_image' => 'https://url.com/storage/images/image.png',
'rcs_link' => 'https://redirect.url',
'rcs_button' => 'Button caption',
'rcs_lifetime' => 172800,
'short_link' => true,
'hook' => 'https://example.org/webhook/url.php',
],
],
], JSON_UNESCAPED_UNICODE);
$ch = curl_init('https://api-async.interconnect.solutions/v1/json');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": True,
"hook": "https://example.org/webhook/url.php",
},
],
}
response = requests.post(
"https://api-async.interconnect.solutions/v1/json",
json=payload,
timeout=30,
)
print(response.json())
const payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "rcs",
"id": 100500,
"phone": 380971234567,
"rcs_signature": "RCSTest",
"rcs_message": "Message text to be sent via RCS",
"rcs_image": "https://url.com/storage/images/image.png",
"rcs_link": "https://redirect.url",
"rcs_button": "Button caption",
"rcs_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
};
const response = await fetch("https://api-async.interconnect.solutions/v1/json", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
console.log(await response.json());
Response parameters
| successinteger Result of request execution | |||||||
| errorstring Error text, returned if success=false | |||||||
| datalist[object] List of objects with the results of request execution
|
Response examples
- Successful
- Access denied
- Error in Alpha-name
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": true,
"data": {
"id": 100500,
"msg_id": 123456789,
"data": 1,
"parts": 1
}
}
]
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": false,
"error": "Access denied"
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": false,
"error": "Error in Alpha-name",
"data": {
"id": 100500
}
}
]
}