Create an identity transfer token
curl --request POST \
--url https://accounts.livechat.com/v2/customer/identity_transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code_challenge": "<string>"
}
'import requests
url = "https://accounts.livechat.com/v2/customer/identity_transfer"
payload = {
"client_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code_challenge": "<string>"
}
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({
client_id: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
code_challenge: '<string>'
})
};
fetch('https://accounts.livechat.com/v2/customer/identity_transfer', 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://accounts.livechat.com/v2/customer/identity_transfer",
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([
'client_id' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'code_challenge' => '<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://accounts.livechat.com/v2/customer/identity_transfer"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\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://accounts.livechat.com/v2/customer/identity_transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://accounts.livechat.com/v2/customer/identity_transfer")
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 \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"identity_transfer_token": "<string>",
"expires_in": 123
}{
"exception_description": "<string>"
}Tokens
Create an identity transfer token
Creates a new identity transfer token, which can be exchanged for a customer access token.
POST
/
identity_transfer
Create an identity transfer token
curl --request POST \
--url https://accounts.livechat.com/v2/customer/identity_transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code_challenge": "<string>"
}
'import requests
url = "https://accounts.livechat.com/v2/customer/identity_transfer"
payload = {
"client_id": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code_challenge": "<string>"
}
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({
client_id: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
code_challenge: '<string>'
})
};
fetch('https://accounts.livechat.com/v2/customer/identity_transfer', 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://accounts.livechat.com/v2/customer/identity_transfer",
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([
'client_id' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'code_challenge' => '<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://accounts.livechat.com/v2/customer/identity_transfer"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\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://accounts.livechat.com/v2/customer/identity_transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://accounts.livechat.com/v2/customer/identity_transfer")
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 \"client_id\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code_challenge\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"identity_transfer_token": "<string>",
"expires_in": 123
}{
"exception_description": "<string>"
}Authorizations
OAuth2 Bearer TokenOAuth2 Agent Bearer Token
This API uses OAuth2 tokens.
Body
application/json
The authorization token type.
agent— use with an OAuth2 Agent Bearer Token.customer— use with an OAuth2 Bearer Token.
Available options:
agent, customer The client ID for which the token is being issued.
The customer ID for which the identity transfer token is being issued. The customer must already exist. Required only if bearer_type=agent.
Was this page helpful?
⌘I