Update Message Provider messageservice.sender.update
Scope:
messageserviceWho can execute the method: administrator
This method updates the message provider.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
CODE* |
Internal identifier of the provider |
|
HANDLER |
URL of the application to which data will be sent |
|
NAME |
Name of the provider. It can be a string or an associative array of localized strings. This parameter is required if the phrase is in a new language |
|
DESCRIPTION |
Description of the provider. It can be a string or an associative array of localized strings. Used only with the |
The request must contain at least one optional parameter.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"CODE":"provider","HANDLER":"https://newhandler.com/","NAME":"New Provider Name","DESCRIPTION":"New Provider Description"}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/messageservice.sender.update
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"CODE":"provider","HANDLER":"https://newhandler.com/","NAME":"New Provider Name","DESCRIPTION":"New Provider Description","auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/messageservice.sender.update
try
{
const response = await $b24.callMethod(
'messageservice.sender.update',
{
CODE: 'provider',
HANDLER: 'https://newhandler.com/',
NAME: 'New Provider Name',
DESCRIPTION: 'New Provider Description'
}
);
const result = response.getData().result;
if(result.error())
alert("Error: " + result.error());
else
alert("Success: " + result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$params = [
'CODE' => 'provider',
'HANDLER' => 'https://newhandler.com/',
'NAME' => 'New Provider Name',
'DESCRIPTION' => 'New Provider Description',
];
$response = $b24Service
->core
->call(
'messageservice.sender.update',
$params
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Success: ' . $result->data();
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error updating sender: ' . $e->getMessage();
}
var params = {
CODE: 'provider',
HANDLER: 'https://newhandler.com/',
NAME: 'New Provider Name',
DESCRIPTION: 'New Provider Description'
};
BX24.callMethod(
'messageservice.sender.update',
params,
function(result)
{
if(result.error())
alert("Error: " + result.error());
else
alert("Success: " + result.data());
}
);
require_once('crest.php');
$params = [
'CODE' => 'provider',
'HANDLER' => 'https://newhandler.com/',
'NAME' => 'New Provider Name',
'DESCRIPTION' => 'New Provider Description'
];
$result = CRest::call(
'messageservice.sender.update',
$params
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"CODE":"provider","NAME":{"en":"New Name","de":"Neuer Name"},"DESCRIPTION":{"en":"New Description"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/messageservice.sender.update
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"CODE":"provider","NAME":{"en":"New Name","de":"Neuer Name"},"DESCRIPTION":{"en":"New Description"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/messageservice.sender.update
try
{
const response = await $b24.callMethod(
'messageservice.sender.update',
{
CODE: 'provider',
NAME: {"en":"New Name","de":"Neuer Name"},
DESCRIPTION: {"en":"New Description"}
}
);
const result = response.getData().result;
alert("Success: " + result);
}
catch( error )
{
alert("Error: " + error);
}
try {
$params = [
'CODE' => 'provider',
'NAME' => ['en' => 'New Name', 'de' => 'Neuer Name'],
'DESCRIPTION' => ['en' => 'New Description'],
];
$response = $b24Service
->core
->call(
'messageservice.sender.update',
$params
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
echo 'Error: ' . $result->error();
} else {
echo 'Success: ' . $result->data();
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error updating sender: ' . $e->getMessage();
}
var params = {
CODE: 'provider',
NAME: {"en":"New Name","de":"Neuer Name"},
DESCRIPTION: {"en":"New Description"}
};
BX24.callMethod(
'messageservice.sender.update',
params,
function(result)
{
if(result.error())
alert("Error: " + result.error());
else
alert("Success: " + result.data());
}
);
require_once('crest.php');
$params = [
'CODE' => 'provider',
'NAME' => [
'en' => 'New Name',
'de' => 'Neuer Name'
],
'DESCRIPTION' => [
'en' => 'New Description'
]
];
$result = CRest::call(
'messageservice.sender.update',
$params
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": true,
"time": {
"start": 1732110540.526103,
"finish": 1732110540.797043,
"duration": 0.27094006538391113,
"processing": 0.007060050964355469,
"date_start": "2024-11-20T15:49:00+02:00",
"date_finish": "2024-11-20T15:49:00+02:00"
}
}
Returned Data
|
Name |
Description |
|
result |
Result of the message provider update |
|
time |
Information about the execution time of the request |
Error Handling
HTTP Status: 400, 403
{
"error": "ERROR_SENDER_NOT_FOUND",
"error_description": "Sender not found!"
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Description |
|
|
Provider not found |
|
|
The |
|
|
At least one of the optional parameters is missing |
|
|
Insufficient permissions to update the provider |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Register SMS Provider or Message Provider messageservice.sender.add
- Get a list of SMS providers or message providers messageservice.sender.list
- Delete SMS provider or messageservice.sender.delete
- Update Message Delivery Status messageservice.message.status.update