Authenticate a user in a conversation
curl --request POST \
--url https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data '
{
"customerExternalId": "customer-xyz",
"token": "cGFzc3dvcmQ="
}
'import requests
url = "https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate"
payload = {
"customerExternalId": "customer-xyz",
"token": "cGFzc3dvcmQ="
}
headers = {
"asapp-api-id": "<api-key>",
"asapp-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'asapp-api-id': '<api-key>',
'asapp-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customerExternalId: 'customer-xyz', token: 'cGFzc3dvcmQ='})
};
fetch('https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate', 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.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate",
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([
'customerExternalId' => 'customer-xyz',
'token' => 'cGFzc3dvcmQ='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"asapp-api-id: <api-key>",
"asapp-api-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://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate"
payload := strings.NewReader("{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("asapp-api-id", "<api-key>")
req.Header.Add("asapp-api-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://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["asapp-api-id"] = '<api-key>'
request["asapp-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "400-01",
"message": "Bad request"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "401-01",
"message": "Unauthorized"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "403-01",
"message": "Forbidden Response"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "404-01",
"message": "Not Found"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "422-01",
"message": "Unprocessable Entity"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "429-01",
"message": "Too Many Requests"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "503-01",
"message": "Service Unavailable"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "500-01",
"message": "Internal server error"
}
}Conversations
Authenticate a user in a conversation
Stores customer-specific authentication credentials for use in integrated flows.
- Can be called at any point during a conversation
- Commonly used at the start of a conversation or after mid-conversation authentication
- May trigger additional actions, such as GenerativeAgent API signals to customer webhooks
This API only accepts the customer-specific auth credentials; the customer is responsible for handling
the specific authentication mechanism.
POST
/
conversation
/
v1
/
conversations
/
{conversationId}
/
authenticate
Authenticate a user in a conversation
curl --request POST \
--url https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate \
--header 'Content-Type: application/json' \
--header 'asapp-api-id: <api-key>' \
--header 'asapp-api-secret: <api-key>' \
--data '
{
"customerExternalId": "customer-xyz",
"token": "cGFzc3dvcmQ="
}
'import requests
url = "https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate"
payload = {
"customerExternalId": "customer-xyz",
"token": "cGFzc3dvcmQ="
}
headers = {
"asapp-api-id": "<api-key>",
"asapp-api-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'asapp-api-id': '<api-key>',
'asapp-api-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customerExternalId: 'customer-xyz', token: 'cGFzc3dvcmQ='})
};
fetch('https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate', 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.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate",
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([
'customerExternalId' => 'customer-xyz',
'token' => 'cGFzc3dvcmQ='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"asapp-api-id: <api-key>",
"asapp-api-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://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate"
payload := strings.NewReader("{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("asapp-api-id", "<api-key>")
req.Header.Add("asapp-api-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://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate")
.header("asapp-api-id", "<api-key>")
.header("asapp-api-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.asapp.com/conversation/v1/conversations/{conversationId}/authenticate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["asapp-api-id"] = '<api-key>'
request["asapp-api-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerExternalId\": \"customer-xyz\",\n \"token\": \"cGFzc3dvcmQ=\"\n}"
response = http.request(request)
puts response.read_body{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "400-01",
"message": "Bad request"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "401-01",
"message": "Unauthorized"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "403-01",
"message": "Forbidden Response"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "404-01",
"message": "Not Found"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "422-01",
"message": "Unprocessable Entity"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "429-01",
"message": "Too Many Requests"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "503-01",
"message": "Service Unavailable"
}
}{
"error": {
"requestId": "8e033668-9f1a-11ec-b909-0242ac120002",
"code": "500-01",
"message": "Internal server error"
}
}Path Parameters
The identifier for a conversation.
Pattern:
^[A-Z0-9]+$Body
application/json
Contains authentication information for a customer in a conversation.
The unique identifier for the customer in your external system.
Example:
"a03839d6-461c-479c-99db-8160174ef12d"
An authentication payload that could contain different types of credentials, such as a token, used to authenticate an end user. All of the fields are optional, but at least one will be required
Show child attributes
Show child attributes
The unique identifier for the connection where responses should be sent.
Example:
"97555020-0276-435f-8104-c378221ba292"
Response
204 - No Content
Was this page helpful?
⌘I