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
}
'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
}
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
})
};
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
]),
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}")
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}")
.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}"
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
}
'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
}
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
})
};
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
]),
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}")
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}")
.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}"
response = http.request(request)
puts response.read_bodyBody
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.
Response
204
Resource activity rate assigned.
⌘I