curl --request POST \
--url https://api.twine.se/v1/org/domain-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_domain": "employee",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"conditions": [
{
"apply_on_actions": [],
"condition": {},
"domain": "employee",
"enabled": true,
"description": "<string>"
}
],
"enabled": true,
"sync_triggers": [
{
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"enabled": false,
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
]
}
'import requests
url = "https://api.twine.se/v1/org/domain-mappings"
payload = {
"from_domain": "employee",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"conditions": [
{
"apply_on_actions": [],
"condition": {},
"domain": "employee",
"enabled": True,
"description": "<string>"
}
],
"enabled": True,
"sync_triggers": [
{
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"enabled": False,
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_domain: 'employee',
source_system_integration_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
target_system_integration_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
to_domain: 'employee',
conditions: [
{
apply_on_actions: [],
condition: {},
domain: 'employee',
enabled: true,
description: '<string>'
}
],
enabled: true,
sync_triggers: [
{
cron_expression: '0 0 * * *',
domain_configuration: {
domain: 'time_report',
from_date: '2023-12-25',
from_date_engine: {},
to_date: '2023-12-25',
to_date_engine: {}
},
enabled: false,
parent_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b'
}
]
})
};
fetch('https://api.twine.se/v1/org/domain-mappings', 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/domain-mappings",
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([
'from_domain' => 'employee',
'source_system_integration_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'target_system_integration_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'to_domain' => 'employee',
'conditions' => [
[
'apply_on_actions' => [
],
'condition' => [
],
'domain' => 'employee',
'enabled' => true,
'description' => '<string>'
]
],
'enabled' => true,
'sync_triggers' => [
[
'cron_expression' => '0 0 * * *',
'domain_configuration' => [
'domain' => 'time_report',
'from_date' => '2023-12-25',
'from_date_engine' => [
],
'to_date' => '2023-12-25',
'to_date_engine' => [
]
],
'enabled' => false,
'parent_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b'
]
]
]),
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/domain-mappings"
payload := strings.NewReader("{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.twine.se/v1/org/domain-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/domain-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"enabled": true,
"from_domain": "employee",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"all_conditions_must_apply": false,
"conditions": [
{
"apply_on_actions": [
"create"
],
"condition": {},
"domain": "employee",
"enabled": true,
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"description": "<string>"
}
],
"description": "Employees from the HR system into payroll",
"inserted_at": "2021-06-01T12:00:00Z",
"mode": "default",
"sync_triggers": [
{
"domain_mapping_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"last_sync_ended_at": "2023-01-01T00:00:00Z",
"last_sync_started_at": "2023-01-01T00:00:00Z",
"next_sync_at": "2023-01-01T00:00:00Z",
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
],
"updated_at": "2021-06-01T12:00:00Z"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}Create Domain Mapping
Create a new domain mapping.
curl --request POST \
--url https://api.twine.se/v1/org/domain-mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_domain": "employee",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"conditions": [
{
"apply_on_actions": [],
"condition": {},
"domain": "employee",
"enabled": true,
"description": "<string>"
}
],
"enabled": true,
"sync_triggers": [
{
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"enabled": false,
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
]
}
'import requests
url = "https://api.twine.se/v1/org/domain-mappings"
payload = {
"from_domain": "employee",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"conditions": [
{
"apply_on_actions": [],
"condition": {},
"domain": "employee",
"enabled": True,
"description": "<string>"
}
],
"enabled": True,
"sync_triggers": [
{
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"enabled": False,
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_domain: 'employee',
source_system_integration_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
target_system_integration_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
to_domain: 'employee',
conditions: [
{
apply_on_actions: [],
condition: {},
domain: 'employee',
enabled: true,
description: '<string>'
}
],
enabled: true,
sync_triggers: [
{
cron_expression: '0 0 * * *',
domain_configuration: {
domain: 'time_report',
from_date: '2023-12-25',
from_date_engine: {},
to_date: '2023-12-25',
to_date_engine: {}
},
enabled: false,
parent_id: '018eae56-8f9d-7ca0-bea3-17f3db6cf75b'
}
]
})
};
fetch('https://api.twine.se/v1/org/domain-mappings', 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/domain-mappings",
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([
'from_domain' => 'employee',
'source_system_integration_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'target_system_integration_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b',
'to_domain' => 'employee',
'conditions' => [
[
'apply_on_actions' => [
],
'condition' => [
],
'domain' => 'employee',
'enabled' => true,
'description' => '<string>'
]
],
'enabled' => true,
'sync_triggers' => [
[
'cron_expression' => '0 0 * * *',
'domain_configuration' => [
'domain' => 'time_report',
'from_date' => '2023-12-25',
'from_date_engine' => [
],
'to_date' => '2023-12-25',
'to_date_engine' => [
]
],
'enabled' => false,
'parent_id' => '018eae56-8f9d-7ca0-bea3-17f3db6cf75b'
]
]
]),
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/domain-mappings"
payload := strings.NewReader("{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.twine.se/v1/org/domain-mappings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/domain-mappings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_domain\": \"employee\",\n \"source_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"target_system_integration_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\",\n \"to_domain\": \"employee\",\n \"conditions\": [\n {\n \"apply_on_actions\": [],\n \"condition\": {},\n \"domain\": \"employee\",\n \"enabled\": true,\n \"description\": \"<string>\"\n }\n ],\n \"enabled\": true,\n \"sync_triggers\": [\n {\n \"cron_expression\": \"0 0 * * *\",\n \"domain_configuration\": {\n \"domain\": \"time_report\",\n \"from_date\": \"2023-12-25\",\n \"from_date_engine\": {},\n \"to_date\": \"2023-12-25\",\n \"to_date_engine\": {}\n },\n \"enabled\": false,\n \"parent_id\": \"018eae56-8f9d-7ca0-bea3-17f3db6cf75b\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"enabled": true,
"from_domain": "employee",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"source_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"target_system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"to_domain": "employee",
"all_conditions_must_apply": false,
"conditions": [
{
"apply_on_actions": [
"create"
],
"condition": {},
"domain": "employee",
"enabled": true,
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"description": "<string>"
}
],
"description": "Employees from the HR system into payroll",
"inserted_at": "2021-06-01T12:00:00Z",
"mode": "default",
"sync_triggers": [
{
"domain_mapping_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"org_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"system_integration_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b",
"cron_expression": "0 0 * * *",
"domain_configuration": {
"domain": "time_report",
"from_date": "2023-12-25",
"from_date_engine": {},
"to_date": "2023-12-25",
"to_date_engine": {}
},
"last_sync_ended_at": "2023-01-01T00:00:00Z",
"last_sync_started_at": "2023-01-01T00:00:00Z",
"next_sync_at": "2023-01-01T00:00:00Z",
"parent_id": "018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
}
],
"updated_at": "2021-06-01T12:00:00Z"
}
}{
"code": 400,
"errors": [],
"message": "Bad Request"
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}Authorizations
Bearer token for authentication
Body
DomainMappingCreateRequest
Schema for creating a domain mapping
The reference domain
finance, employee_competence, competence, expense_transaction, salary_transaction, file_transfer, project, org_unit, customer, schedule, time_report, employee "employee"
The UUID of the source system integration
"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
The UUID of the target system integration
"018eae56-8f9d-7ca0-bea3-17f3db6cf75b"
The reference domain
finance, employee_competence, competence, expense_transaction, salary_transaction, file_transfer, project, org_unit, customer, schedule, time_report, employee "employee"
List of conditions to create and attach to the created domain mapping.
Show child attributes
Show child attributes
Whether the domain mapping is enabled. Defaults to true.
true
List of sync triggers to create and attach to the created domain mapping. NOTE: Currently only one sync trigger can be created while creating a domain mapping. If multiple sync triggers are specified, only the first will be used. This restriction will be lifted in the future.
Show child attributes
Show child attributes
Response
Domain Mapping Response
Response schema for a single domain mapping.
An object representing a domain mapping.
Show child attributes
Show child attributes