Create an SDK Token
curl --request POST \
--url https://live.deck.co/api/v1/link/token/create \
--header 'Content-Type: application/json' \
--header 'x-deck-client-id: <api-key>' \
--header 'x-deck-secret: <api-key>' \
--data '
{
"customization_name": "<string>",
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"webhook_url": "<string>"
}
'import requests
url = "https://live.deck.co/api/v1/link/token/create"
payload = {
"customization_name": "<string>",
"source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"webhook_url": "<string>"
}
headers = {
"x-deck-client-id": "<api-key>",
"x-deck-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-deck-client-id': '<api-key>',
'x-deck-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customization_name: '<string>',
source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
webhook_url: '<string>'
})
};
fetch('https://live.deck.co/api/v1/link/token/create', 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://live.deck.co/api/v1/link/token/create",
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([
'customization_name' => '<string>',
'source_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-deck-client-id: <api-key>",
"x-deck-secret: <api-key>"
],
]);
$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://live.deck.co/api/v1/link/token/create"
payload := strings.NewReader("{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-deck-client-id", "<api-key>")
req.Header.Add("x-deck-secret", "<api-key>")
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://live.deck.co/api/v1/link/token/create")
.header("x-deck-client-id", "<api-key>")
.header("x-deck-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.deck.co/api/v1/link/token/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-deck-client-id"] = '<api-key>'
request["x-deck-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"link_token": "<string>"
}{
"error_message": "<string>",
"display_message": "<string>"
}Auth SDK
Create an SDK Token
Generates a short-lived SDK token used to initialize the Auth SDK. The token expires after 20 minutes.
POST
/
link
/
token
/
create
Create an SDK Token
curl --request POST \
--url https://live.deck.co/api/v1/link/token/create \
--header 'Content-Type: application/json' \
--header 'x-deck-client-id: <api-key>' \
--header 'x-deck-secret: <api-key>' \
--data '
{
"customization_name": "<string>",
"source_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"webhook_url": "<string>"
}
'import requests
url = "https://live.deck.co/api/v1/link/token/create"
payload = {
"customization_name": "<string>",
"source_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"webhook_url": "<string>"
}
headers = {
"x-deck-client-id": "<api-key>",
"x-deck-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-deck-client-id': '<api-key>',
'x-deck-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customization_name: '<string>',
source_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
webhook_url: '<string>'
})
};
fetch('https://live.deck.co/api/v1/link/token/create', 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://live.deck.co/api/v1/link/token/create",
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([
'customization_name' => '<string>',
'source_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'webhook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-deck-client-id: <api-key>",
"x-deck-secret: <api-key>"
],
]);
$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://live.deck.co/api/v1/link/token/create"
payload := strings.NewReader("{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-deck-client-id", "<api-key>")
req.Header.Add("x-deck-secret", "<api-key>")
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://live.deck.co/api/v1/link/token/create")
.header("x-deck-client-id", "<api-key>")
.header("x-deck-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.deck.co/api/v1/link/token/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-deck-client-id"] = '<api-key>'
request["x-deck-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customization_name\": \"<string>\",\n \"source_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"webhook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"link_token": "<string>"
}{
"error_message": "<string>",
"display_message": "<string>"
}Authorizations
Enter your client id
Enter your secret
Body
application/jsontext/jsonapplication/*+json
The language that Link should be displayed in.
Available options:
EN, ES, FR, DE, PT The name of the customization from Deck dashboard to be applied to this Widget session. If not specified, the default customization will be used. Values provided in this payload override the dashboard customization settings.
You can specify exactly the sources to be shown in Link by providing a list of source ids.
The webhook URL to receive update events.
Response
OK
The link_token, must be provided when calling Link endpoints, for identifying the Link session.
Minimum string length:
1Was this page helpful?
⌘I