Reassign multiple delegation recipients
curl --request PATCH \
--url https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"delegationIds": [
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
],
"recipientType": "PERSONNEL_IN_POSITION",
"delegationRecipients": [
{
"recipientUserId": "485fa115-52d0-4466-baff-740447a60774",
"recipientPositionId": "14f5a115-52d0-4466-baff-740447a60774",
"isInvalid": false
}
],
"recipientAutoIssue": false
}
'import requests
url = "https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients"
payload = {
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"delegationIds": ["123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"],
"recipientType": "PERSONNEL_IN_POSITION",
"delegationRecipients": [
{
"recipientUserId": "485fa115-52d0-4466-baff-740447a60774",
"recipientPositionId": "14f5a115-52d0-4466-baff-740447a60774",
"isInvalid": False
}
],
"recipientAutoIssue": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: '123e4567-e89b-12d3-a456-426614174000',
delegationIds: ['123e4567-e89b-12d3-a456-426614174001', '123e4567-e89b-12d3-a456-426614174002'],
recipientType: 'PERSONNEL_IN_POSITION',
delegationRecipients: [
{
recipientUserId: '485fa115-52d0-4466-baff-740447a60774',
recipientPositionId: '14f5a115-52d0-4466-baff-740447a60774',
isInvalid: false
}
],
recipientAutoIssue: false
})
};
fetch('https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients', 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://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tenantId' => '123e4567-e89b-12d3-a456-426614174000',
'delegationIds' => [
'123e4567-e89b-12d3-a456-426614174001',
'123e4567-e89b-12d3-a456-426614174002'
],
'recipientType' => 'PERSONNEL_IN_POSITION',
'delegationRecipients' => [
[
'recipientUserId' => '485fa115-52d0-4466-baff-740447a60774',
'recipientPositionId' => '14f5a115-52d0-4466-baff-740447a60774',
'isInvalid' => false
]
],
'recipientAutoIssue' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients"
payload := strings.NewReader("{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}"
response = http.request(request)
puts response.read_bodyDelegations
Reassign multiple delegation recipients
PATCH
/
v1
/
delegations
/
bulk-reassign-recipients
Reassign multiple delegation recipients
curl --request PATCH \
--url https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"delegationIds": [
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
],
"recipientType": "PERSONNEL_IN_POSITION",
"delegationRecipients": [
{
"recipientUserId": "485fa115-52d0-4466-baff-740447a60774",
"recipientPositionId": "14f5a115-52d0-4466-baff-740447a60774",
"isInvalid": false
}
],
"recipientAutoIssue": false
}
'import requests
url = "https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients"
payload = {
"tenantId": "123e4567-e89b-12d3-a456-426614174000",
"delegationIds": ["123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"],
"recipientType": "PERSONNEL_IN_POSITION",
"delegationRecipients": [
{
"recipientUserId": "485fa115-52d0-4466-baff-740447a60774",
"recipientPositionId": "14f5a115-52d0-4466-baff-740447a60774",
"isInvalid": False
}
],
"recipientAutoIssue": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: '123e4567-e89b-12d3-a456-426614174000',
delegationIds: ['123e4567-e89b-12d3-a456-426614174001', '123e4567-e89b-12d3-a456-426614174002'],
recipientType: 'PERSONNEL_IN_POSITION',
delegationRecipients: [
{
recipientUserId: '485fa115-52d0-4466-baff-740447a60774',
recipientPositionId: '14f5a115-52d0-4466-baff-740447a60774',
isInvalid: false
}
],
recipientAutoIssue: false
})
};
fetch('https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients', 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://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tenantId' => '123e4567-e89b-12d3-a456-426614174000',
'delegationIds' => [
'123e4567-e89b-12d3-a456-426614174001',
'123e4567-e89b-12d3-a456-426614174002'
],
'recipientType' => 'PERSONNEL_IN_POSITION',
'delegationRecipients' => [
[
'recipientUserId' => '485fa115-52d0-4466-baff-740447a60774',
'recipientPositionId' => '14f5a115-52d0-4466-baff-740447a60774',
'isInvalid' => false
]
],
'recipientAutoIssue' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients"
payload := strings.NewReader("{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.us.aptlydone.com/decision/v1/delegations/bulk-reassign-recipients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegationIds\": [\n \"123e4567-e89b-12d3-a456-426614174001\",\n \"123e4567-e89b-12d3-a456-426614174002\"\n ],\n \"recipientType\": \"PERSONNEL_IN_POSITION\",\n \"delegationRecipients\": [\n {\n \"recipientUserId\": \"485fa115-52d0-4466-baff-740447a60774\",\n \"recipientPositionId\": \"14f5a115-52d0-4466-baff-740447a60774\",\n \"isInvalid\": false\n }\n ],\n \"recipientAutoIssue\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Tenant ID
Example:
"123e4567-e89b-12d3-a456-426614174000"
Array of delegation IDs to reassign recipients to
Example:
[
"123e4567-e89b-12d3-a456-426614174001",
"123e4567-e89b-12d3-a456-426614174002"
]
Delegation recipient type
Example:
"PERSONNEL_IN_POSITION"
Delegation Recipients
Minimum array length:
1Show child attributes
Show child attributes
Auto Issue option for Delegation recipient of type PERSONNEL_IN_POSITION
Example:
false
Response
200
Recipients are being reassigned to delegations
Was this page helpful?
āI