Create Credentials Link
curl --request POST \
--url https://api.twine.se/v1/org/system-integrations/{id}/credentials-link \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.twine.se/v1/org/system-integrations/{id}/credentials-link"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.twine.se/v1/org/system-integrations/{id}/credentials-link', 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/system-integrations/{id}/credentials-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.twine.se/v1/org/system-integrations/{id}/credentials-link"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/system-integrations/{id}/credentials-link")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/system-integrations/{id}/credentials-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"expires_at": "2023-11-07T05:31:56Z",
"url": "<string>"
}
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 404,
"errors": [],
"message": "Not Found"
}{
"code": 422,
"errors": [],
"message": "Unprocessable Entity"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}SystemIntegrations
Create Credentials Link
Creates a link your customer opens to enter the credentials for a system integration themselves, without a Twine login. You never see what they enter.
The link collects credentials only. For a system whose API can live on any host (Flex HRM,
Agda PS, S3, SFTP), set where the integration connects first (api_endpoint_url, or
system_custom.s3_host / system_custom.sftp_host); until then this answers 422. The form
shows that value to your customer read-only.
The link is valid for 5 days and can be submitted once; create a new one if it expires or has
been used. Creating one requires the administrate action on the integration, since whoever
holds the link can set its credentials.
POST
/
v1
/
org
/
system-integrations
/
{id}
/
credentials-link
Create Credentials Link
curl --request POST \
--url https://api.twine.se/v1/org/system-integrations/{id}/credentials-link \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.twine.se/v1/org/system-integrations/{id}/credentials-link"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.twine.se/v1/org/system-integrations/{id}/credentials-link', 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/system-integrations/{id}/credentials-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.twine.se/v1/org/system-integrations/{id}/credentials-link"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/system-integrations/{id}/credentials-link")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twine.se/v1/org/system-integrations/{id}/credentials-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"expires_at": "2023-11-07T05:31:56Z",
"url": "<string>"
}
}{
"code": 403,
"errors": [],
"message": "Forbidden"
}{
"code": 404,
"errors": [],
"message": "Not Found"
}{
"code": 422,
"errors": [],
"message": "Unprocessable Entity"
}{
"code": 500,
"errors": [],
"message": "Internal Server Error"
}