Add Measurement Unit crm.measure.add
Scope:
crmWho can execute the method: any user
This method adds a new measurement unit.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
fields* |
Set of fields — an array of the form To find out the required format of the fields, execute the method crm.measure.fields and check the format of the received values for these fields |
Parameter fields
Required parameters are marked with *
|
Name |
Description |
|
CODE* |
Code |
|
MEASURE_TITLE* |
Name of the measurement unit |
|
SYMBOL_RUS |
Symbol |
|
SYMBOL_INTL |
International symbol |
|
SYMBOL_LETTER_INTL |
International letter code |
|
IS_DEFAULT |
Default |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"CODE":"212","MEASURE_TITLE":"Watt","SYMBOL_RUS":"W","SYMBOL_INTL":"W","SYMBOL_LETTER_INTL":"WTT","IS_DEFAULT":"N"}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.measure.add
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"fields":{"CODE":"212","MEASURE_TITLE":"Watt","SYMBOL_RUS":"W","SYMBOL_INTL":"W","SYMBOL_LETTER_INTL":"WTT","IS_DEFAULT":"N"},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.measure.add
try
{
const response = await $b24.callMethod(
'crm.measure.add',
{
fields: {
"CODE": "212",
"MEASURE_TITLE": "Watt",
"SYMBOL_RUS": "W",
"SYMBOL_INTL": "W",
"SYMBOL_LETTER_INTL": "WTT",
"IS_DEFAULT": "N"
}
}
);
const result = response.getData().result;
console.info('Created measurement unit with ID ' + result);
}
catch(error)
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'crm.measure.add',
[
'fields' => [
'CODE' => '212',
'MEASURE_TITLE' => 'Watt',
'SYMBOL_RUS' => 'W',
'SYMBOL_INTL' => 'W',
'SYMBOL_LETTER_INTL' => 'WTT',
'IS_DEFAULT' => 'N',
],
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Created measurement unit with ID ' . $result;
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error creating measurement unit: ' . $e->getMessage();
}
BX24.callMethod(
"crm.measure.add",
{
fields: {
"CODE": "212",
"MEASURE_TITLE": "Watt",
"SYMBOL_RUS": "W",
"SYMBOL_INTL": "W",
"SYMBOL_LETTER_INTL": "WTT",
"IS_DEFAULT": "N"
}
},
function(result)
{
if(result.error())
console.error(result.error());
else
console.info("Created measurement unit with ID " + result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.measure.add',
[
'fields' =>
[
'CODE' => '212',
'MEASURE_TITLE' => 'Watt',
'SYMBOL_RUS' => 'W',
'SYMBOL_INTL' => 'W',
'SYMBOL_LETTER_INTL' => 'WTT',
'IS_DEFAULT' => 'N'
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Continue Learning
- Update Measurement Unit crm.measure.update
- Get the values of the fields of the unit of measurement crm.measure.get
- Get the list of measurement units crm.measure.list
- Delete Measurement Unit crm.measure.delete
- Get available fields of crm.measure.fields