Assign activity rate
curl --request POST \
--url https://api.example.com/api/directory/resources.assign-activity-rate \
--header 'Content-Type: application/json' \
--data '
{
"resource_id": "872815618512410358",
"date_range": "2019-11-11/2019-12-12",
"average_rate": 100,
"work_regime_id": "872815618512410358",
"indemnity_enabled": true,
"compensation_enabled": true,
"trainee": false,
"apprentice": false,
"paid_hourly": false,
"activity_rate_patterns": [
{
"monday": 100,
"tuesday": 100,
"wednesday": 100,
"thursday": 100,
"friday": 100,
"saturday": 100,
"sunday": 100
}
],
"external_id": "<string>"
}
'import requests
url = "https://api.example.com/api/directory/resources.assign-activity-rate"
payload = {
"resource_id": "872815618512410358",
"date_range": "2019-11-11/2019-12-12",
"average_rate": 100,
"work_regime_id": "872815618512410358",
"indemnity_enabled": True,
"compensation_enabled": True,
"trainee": False,
"apprentice": False,
"paid_hourly": False,
"activity_rate_patterns": [
{
"monday": 100,
"tuesday": 100,
"wednesday": 100,
"thursday": 100,
"friday": 100,
"saturday": 100,
"sunday": 100
}
],
"external_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
resource_id: '872815618512410358',
date_range: '2019-11-11/2019-12-12',
average_rate: 100,
work_regime_id: '872815618512410358',
indemnity_enabled: true,
compensation_enabled: true,
trainee: false,
apprentice: false,
paid_hourly: false,
activity_rate_patterns: [
{
monday: 100,
tuesday: 100,
wednesday: 100,
thursday: 100,
friday: 100,
saturday: 100,
sunday: 100
}
],
external_id: '<string>'
})
};
fetch('https://api.example.com/api/directory/resources.assign-activity-rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/directory/resources.assign-activity-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_id' => '872815618512410358',
'date_range' => '2019-11-11/2019-12-12',
'average_rate' => 100,
'work_regime_id' => '872815618512410358',
'indemnity_enabled' => true,
'compensation_enabled' => true,
'trainee' => false,
'apprentice' => false,
'paid_hourly' => false,
'activity_rate_patterns' => [
[
'monday' => 100,
'tuesday' => 100,
'wednesday' => 100,
'thursday' => 100,
'friday' => 100,
'saturday' => 100,
'sunday' => 100
]
],
'external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/directory/resources.assign-activity-rate"
payload := strings.NewReader("{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/directory/resources.assign-activity-rate")
.header("Content-Type", "application/json")
.body("{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/directory/resources.assign-activity-rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyResources
Assign activity rate
Assigns an activity rate to a resource for a date range. Please be aware that assigning a new activity rate might modify other activity rates periods and recalculate retroactively work and vacation balances.
POST
/
api
/
directory
/
resources.assign-activity-rate
Assign activity rate
curl --request POST \
--url https://api.example.com/api/directory/resources.assign-activity-rate \
--header 'Content-Type: application/json' \
--data '
{
"resource_id": "872815618512410358",
"date_range": "2019-11-11/2019-12-12",
"average_rate": 100,
"work_regime_id": "872815618512410358",
"indemnity_enabled": true,
"compensation_enabled": true,
"trainee": false,
"apprentice": false,
"paid_hourly": false,
"activity_rate_patterns": [
{
"monday": 100,
"tuesday": 100,
"wednesday": 100,
"thursday": 100,
"friday": 100,
"saturday": 100,
"sunday": 100
}
],
"external_id": "<string>"
}
'import requests
url = "https://api.example.com/api/directory/resources.assign-activity-rate"
payload = {
"resource_id": "872815618512410358",
"date_range": "2019-11-11/2019-12-12",
"average_rate": 100,
"work_regime_id": "872815618512410358",
"indemnity_enabled": True,
"compensation_enabled": True,
"trainee": False,
"apprentice": False,
"paid_hourly": False,
"activity_rate_patterns": [
{
"monday": 100,
"tuesday": 100,
"wednesday": 100,
"thursday": 100,
"friday": 100,
"saturday": 100,
"sunday": 100
}
],
"external_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
resource_id: '872815618512410358',
date_range: '2019-11-11/2019-12-12',
average_rate: 100,
work_regime_id: '872815618512410358',
indemnity_enabled: true,
compensation_enabled: true,
trainee: false,
apprentice: false,
paid_hourly: false,
activity_rate_patterns: [
{
monday: 100,
tuesday: 100,
wednesday: 100,
thursday: 100,
friday: 100,
saturday: 100,
sunday: 100
}
],
external_id: '<string>'
})
};
fetch('https://api.example.com/api/directory/resources.assign-activity-rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/directory/resources.assign-activity-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_id' => '872815618512410358',
'date_range' => '2019-11-11/2019-12-12',
'average_rate' => 100,
'work_regime_id' => '872815618512410358',
'indemnity_enabled' => true,
'compensation_enabled' => true,
'trainee' => false,
'apprentice' => false,
'paid_hourly' => false,
'activity_rate_patterns' => [
[
'monday' => 100,
'tuesday' => 100,
'wednesday' => 100,
'thursday' => 100,
'friday' => 100,
'saturday' => 100,
'sunday' => 100
]
],
'external_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/directory/resources.assign-activity-rate"
payload := strings.NewReader("{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/directory/resources.assign-activity-rate")
.header("Content-Type", "application/json")
.body("{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/directory/resources.assign-activity-rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_id\": \"872815618512410358\",\n \"date_range\": \"2019-11-11/2019-12-12\",\n \"average_rate\": 100,\n \"work_regime_id\": \"872815618512410358\",\n \"indemnity_enabled\": true,\n \"compensation_enabled\": true,\n \"trainee\": false,\n \"apprentice\": false,\n \"paid_hourly\": false,\n \"activity_rate_patterns\": [\n {\n \"monday\": 100,\n \"tuesday\": 100,\n \"wednesday\": 100,\n \"thursday\": 100,\n \"friday\": 100,\n \"saturday\": 100,\n \"sunday\": 100\n }\n ],\n \"external_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyA stable version of this route is available: 26.06.25.
This page is a preview of upcoming changes to this route: they may change without notice until they become part of a new stable version.
Body
application/json
Example:
"872815618512410358"
Example:
"2019-11-11/2019-12-12"
Example:
100
If null, it will adopt the sector’s work regime.
Example:
"872815618512410358"
If not specified, it will adopt the instance indemnity configuration.
If not specified, it will adopt the instance compensation configuration.
Rate per weekday, one entry per week of the pattern, from Monday. If not specified, the rate is spread evenly over the work regime's worked days.
Show child attributes
Show child attributes
External reference of the contract, unique across the instance.
Response
204
Resource activity rate assigned.