Update Employee Mapping
curl --request PUT \
--url https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"external_id": "<string>"
}
}
'import requests
url = "https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}"
payload = { "data": { "external_id": "<string>" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {external_id: '<string>'}})
};
fetch('https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}', 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.twine.se/v1/org/employees/mappings/{employee_mapping_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'external_id' => '<string>'
]
]),
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://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}"
payload := strings.NewReader("{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"employee_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"inserted_at": "2023-11-07T05:31:56Z",
"status": "active",
"status_updated_at": "2023-11-07T05:31:56Z",
"system_integration_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 404,
"errors": [],
"message": "Not Found"
}{
"code": 422,
"errors": [],
"message": "Unprocessable Entity"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}EmployeeMappings
Update Employee Mapping
Update an existing employee mapping for a given organization.
Permissions required: Employee: Update, SystemIntegration: Get
PUT
/
v1
/
org
/
employees
/
mappings
/
{employee_mapping_id}
Update Employee Mapping
curl --request PUT \
--url https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"external_id": "<string>"
}
}
'import requests
url = "https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}"
payload = { "data": { "external_id": "<string>" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {external_id: '<string>'}})
};
fetch('https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}', 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.twine.se/v1/org/employees/mappings/{employee_mapping_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'external_id' => '<string>'
]
]),
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://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}"
payload := strings.NewReader("{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/employees/mappings/{employee_mapping_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"external_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"employee_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"inserted_at": "2023-11-07T05:31:56Z",
"status": "active",
"status_updated_at": "2023-11-07T05:31:56Z",
"system_integration_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 404,
"errors": [],
"message": "Not Found"
}{
"code": 422,
"errors": [],
"message": "Unprocessable Entity"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}Authorizations
Bearer token for authentication
Path Parameters
The ID of the employee mapping to update
Body
application/json
Employee Mapping Update Request
Request schema for updating an employee mapping
Updates an employee mapping
Show child attributes
Show child attributes
Response
Employee mapping Response
An employee mapping
Describes the relationship between an employee and a system to which the employee belongs. Only included if requested by submitting relations=employee_mappings.
Show child attributes
Show child attributes
⌘I