curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external"
payload = {
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
name: 'Custom 1232131232132'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 200,
"status": "success",
"data": {
"id": 12345,
"name": "Custom 1232131232132",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z",
"active": true
}
}
{
"status": "ERROR",
"code": "ZC001",
"message": "Entity is not associated"
}
{
"error": "LeaveTypeNotFoundError",
"message": "Leave type with external ID 'type external' not found",
"code": "ZC004"
}
User Leaves
Update Leave Type
Updates an existing leave type in your COR instance using its external ID
PUT
/
v2
/
integrations
/
leaves-types
/
{id}
curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external"
payload = {
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
name: 'Custom 1232131232132'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 200,
"status": "success",
"data": {
"id": 12345,
"name": "Custom 1232131232132",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z",
"active": true
}
}
{
"status": "ERROR",
"code": "ZC001",
"message": "Entity is not associated"
}
{
"error": "LeaveTypeNotFoundError",
"message": "Leave type with external ID 'type external' not found",
"code": "ZC004"
}
Updates an existing leave type in your COR instance using its external ID.
Path Parameters
string
required
External leave type ID that was used when creating the leave type
Request Body Requirements
string
required
Updated leave type name
Known Errors
ZC001— Entity is not associated (leave type with the specified external ID not found)LeaveTypeNotFoundError— No leave type found with the specified external ID for this sourceValidationError— Missing requiredmetadata.sourceornamefield
curl --location --request PUT 'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external"
payload = {
"metadata": {
"source": "GLOBANT"
},
"name": "Custom 1232131232132"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/leaves-types/type%20external',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'GLOBANT'
},
name: 'Custom 1232131232132'
})
}
);
const data = await response.json();
console.log(data);
{
"statusCode": 200,
"status": "success",
"data": {
"id": 12345,
"name": "Custom 1232131232132",
"company_id": 2336,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z",
"active": true
}
}
{
"status": "ERROR",
"code": "ZC001",
"message": "Entity is not associated"
}
{
"error": "LeaveTypeNotFoundError",
"message": "Leave type with external ID 'type external' not found",
"code": "ZC004"
}
Was this page helpful?
⌘I

