curl --request PUT \
--url https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id}"
payload = { "company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_company_id": "<string>",
"name": "<string>",
"registration_number": "<string>",
"country": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linked_by": "rule",
"can_create_company": true
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The connection's accounting data, booking history or purchase orders come from this company; or the connection supplies the accounts of its linked companies and the link would give a workspace company a second of the connection's companies (company_several_entities), or a company whose accounts come from another connection (conflict).",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Link a connection's company
Links one of the connection’s companies to a workspace company, or marks it not linked with null. A choice made here is kept: no rule changes it. New recipients of the invoices the connection reads for that company belong to the linked workspace company, and its accounting data and booking history are that company’s. 409 while the connection’s accounting data, booking history or purchase order reading or writing is on and comes from this company: turn them off first. A connection that supplies the accounts of every workspace company one of its companies is linked to (Microsoft Finance) keeps all of those links while its accounting data is on, and refuses a link that gives a workspace company a second of its companies (company_several_entities) or links a company whose accounts come from another connection.
curl --request PUT \
--url https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({company_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/integrations/{id}/company-links/{link_id}"
payload = { "company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_company_id": "<string>",
"name": "<string>",
"registration_number": "<string>",
"country": "<string>",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linked_by": "rule",
"can_create_company": true
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The connection's accounting data, booking history or purchase orders come from this company; or the connection supplies the accounts of its linked companies and the link would give a workspace company a second of the connection's companies (company_several_entities), or a company whose accounts come from another connection (conflict).",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Authorizations
Headers
Body
Response
The company with its link.
Whether createCompaniesFromLinks can make a workspace company of it: the provider states a registration number that can be one of its country's (the country the workspace's companies share, when it states none). Otherwise it can only be linked to a company the workspace has.