Create conversation
curl --request POST \
--url https://api.helloannie.com/v1/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"messages": [
{
"input": "<string>"
}
],
"idleTimeoutMinutes": 2,
"maxOpenMinutes": 2
}
'import requests
url = "https://api.helloannie.com/v1/conversations"
payload = {
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"messages": [{ "input": "<string>" }],
"idleTimeoutMinutes": 2,
"maxOpenMinutes": 2
}
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({
botId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
toNumber: '<string>',
messages: [{input: '<string>'}],
idleTimeoutMinutes: 2,
maxOpenMinutes: 2
})
};
fetch('https://api.helloannie.com/v1/conversations', 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.helloannie.com/v1/conversations",
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([
'botId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'toNumber' => '<string>',
'messages' => [
[
'input' => '<string>'
]
],
'idleTimeoutMinutes' => 2,
'maxOpenMinutes' => 2
]),
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://api.helloannie.com/v1/conversations"
payload := strings.NewReader("{\n \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\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://api.helloannie.com/v1/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helloannie.com/v1/conversations")
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 \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationTags": [
"<string>"
],
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"displayName": "<string>"
}
],
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medium": "CHAT",
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"fromNumber": "<string>",
"summary": "<string>",
"billed": true,
"actionsNeeded": [
"<string>"
],
"topic": "<string>",
"duration": 1500,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"status": "OPEN"
}
}{
"success": false,
"data": {},
"message": "<string>"
}Conversations
Create conversation
Create a new conversation with the specified medium and bot. An anonymous user is automatically created for the conversation. Optionally seed the conversation with initial messages that will be attached in order.
POST
/
conversations
Create conversation
curl --request POST \
--url https://api.helloannie.com/v1/conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"messages": [
{
"input": "<string>"
}
],
"idleTimeoutMinutes": 2,
"maxOpenMinutes": 2
}
'import requests
url = "https://api.helloannie.com/v1/conversations"
payload = {
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"messages": [{ "input": "<string>" }],
"idleTimeoutMinutes": 2,
"maxOpenMinutes": 2
}
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({
botId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
toNumber: '<string>',
messages: [{input: '<string>'}],
idleTimeoutMinutes: 2,
maxOpenMinutes: 2
})
};
fetch('https://api.helloannie.com/v1/conversations', 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.helloannie.com/v1/conversations",
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([
'botId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'toNumber' => '<string>',
'messages' => [
[
'input' => '<string>'
]
],
'idleTimeoutMinutes' => 2,
'maxOpenMinutes' => 2
]),
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://api.helloannie.com/v1/conversations"
payload := strings.NewReader("{\n \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\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://api.helloannie.com/v1/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helloannie.com/v1/conversations")
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 \"botId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"toNumber\": \"<string>\",\n \"messages\": [\n {\n \"input\": \"<string>\"\n }\n ],\n \"idleTimeoutMinutes\": 2,\n \"maxOpenMinutes\": 2\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationTags": [
"<string>"
],
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"displayName": "<string>"
}
],
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medium": "CHAT",
"botId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"fromNumber": "<string>",
"summary": "<string>",
"billed": true,
"actionsNeeded": [
"<string>"
],
"topic": "<string>",
"duration": 1500,
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"status": "OPEN"
}
}{
"success": false,
"data": {},
"message": "<string>"
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Request body for creating a new conversation
Optional. Auto-close the conversation after this many minutes with no inbound or outbound activity. Omit to disable the idle timeout (the conversation will remain open until the platform max is reached). Values larger than the platform max are clamped to the platform max.
Required range:
x >= 1Must be a multiple of 1