Crm · Compensation
Get compensation settings
Gets compensation claim settings for the organization identified by organizationId. Returns the settings, or null if compensation claims are not set up.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Who may call it
- The caller must have access to the organization.
- The caller needs the
crmSettings.readpermission.
Request
Path parameters
-
organizationIdidrequired
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/compensation/settings' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/compensation/settings", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/crm/compensation/settings', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
cadencestringmonthquarterhalfYearyear -
submissionDeadlineDaysinteger0–90
-
reminderDaysBeforeDeadlineinteger0–30
-
ratesobject[]at most 50 items
10 properties
-
_idid -
typestringhourlyflatmileage -
labelstring1–60 characters
-
amountinteger0–999999
-
accountinteger1–999999999
-
costCenter1numbernullable1–99999999
-
costCenter2numbernullable1–99999999
-
activeboolean -
limitidnullable -
oncePerEntryboolean
-
-
limitsobject[]at most 10 items
5 properties
-
_idid -
labelstring1–60 characters
-
amountintegerat most 9999999
-
dailyAmountintegernullableat most 9999999
-
monthlyAmountintegernullableat most 9999999
-
-
entryFieldsobject[]at most 10 items
6 properties
-
_idid -
typestringtextselectmultiSelect -
labelstring1–60 characters
-
entryTypesstring[]at most 4 items
hoursflatRatesmileageexpenses -
requiredboolean -
optionsstring[]at most 50 items · each 1–100 characters
-
-
expensesobject6 properties
-
enabledboolean -
accountintegernullable1–999999999
-
costCenter1numbernullable1–99999999
-
costCenter2numbernullable1–99999999
-
maxAmountintegernullableat most 9999999999
-
receiptRequiredboolean
-
-
correctionAccountintegernullable1–999999999
-
correctionCostCenter1numbernullable1–99999999
-
correctionCostCenter2numbernullable1–99999999
-
waiverobject2 properties
-
enabledboolean -
accountintegernullable1–999999999
-
-
declarationTextstringat most 4000 characters
-
reviewerUserIdsstring[]at most 50 items · each at least 1 characters
-
reviewerRulesobject[]at most 50 items
2 properties
-
conditionobject2 properties
-
operatorstringandor -
conditions(object (recursive) | object)[]at least 1 items
4 properties
-
leftobject | object of anyVariant 1: 1 property
-
variablestringat least 1 characters
Variant 2: 4 properties
-
sourceobject1 property
-
variablestringat least 1 characters
-
-
lookupobjectnullable1 property
-
variablestringat least 1 characters
-
-
arrayboolean -
selectobject (recursive)
Variant 3: 2 properties
-
funcstring33 values
concatifEmptylowercaseuppercasesubstringtrimabsceilfloorminmaxmodsumsubmuldivavgmedparseNumberformatNumberdateOnlydateTimedateOnlyPartdateTimePartagedateOnlyDifferencedateTimeDifferencesetDateOnlysetDateTimeaddDateOnlyaddDateTimeformatDateOnlyformatDateTime -
paramsobject (recursive)[]
Variant 4: 1 property
-
literalnumber[] | number
Variant 5: 3 properties
-
ifobject (recursive) -
thenobject (recursive) -
elseobject (recursive)
-
-
cmpFuncstring15 values
eqisSetltltegtgteincludescontainsstartsWithendsWithbeforebeforeAtafterafterAtisToday -
rightobject | object of anyVariant 1: 1 property
-
variablestringat least 1 characters
Variant 2: 4 properties
-
sourceobject1 property
-
variablestringat least 1 characters
-
-
lookupobjectnullable1 property
-
variablestringat least 1 characters
-
-
arrayboolean -
selectobject (recursive)
Variant 3: 2 properties
-
funcstring33 values
concatifEmptylowercaseuppercasesubstringtrimabsceilfloorminmaxmodsumsubmuldivavgmedparseNumberformatNumberdateOnlydateTimedateOnlyPartdateTimePartagedateOnlyDifferencedateTimeDifferencesetDateOnlysetDateTimeaddDateOnlyaddDateTimeformatDateOnlyformatDateTime -
paramsobject (recursive)[]
Variant 4: 1 property
-
literalnumber[] | number
Variant 5: 3 properties
-
ifobject (recursive) -
thenobject (recursive) -
elseobject (recursive)
-
-
negateboolean
-
-
-
reviewerUserIdsstring[]1–50 items · each at least 1 characters
-
-
defaultMandateidnullable
{
"cadence": "month",
"submissionDeadlineDays": 0,
"reminderDaysBeforeDeadline": 0,
"rates": [
{
"_id": "000000000000000000000001",
"type": "hourly",
"label": "string",
"amount": 0,
"account": 1,
"costCenter1": 1,
"costCenter2": 1,
"active": true,
"limit": "000000000000000000000001",
"oncePerEntry": true
}
],
"limits": [
{
"_id": "000000000000000000000001",
"label": "string",
"amount": 1,
"dailyAmount": 1,
"monthlyAmount": 1
}
],
"entryFields": [
{
"_id": "000000000000000000000001",
"type": "text",
"label": "string",
"entryTypes": [
"hours"
],
"required": true,
"options": [
"string"
]
}
],
"expenses": {
"enabled": true,
"account": 1,
"costCenter1": 1,
"costCenter2": 1,
"maxAmount": 1,
"receiptRequired": true
},
"correctionAccount": 1,
"correctionCostCenter1": 1,
"correctionCostCenter2": 1,
"waiver": {
"enabled": true,
"account": 1
},
"declarationText": "string",
"reviewerUserIds": [
"string"
],
"reviewerRules": [
{
"condition": {
"operator": "and",
"conditions": [
null
]
},
"reviewerUserIds": [
"string"
]
}
],
"defaultMandate": "000000000000000000000001"
}
Errors
No errors of its own are known for this endpoint.
Errors nearly every request can meet are listed under Errors.