curl --request POST \
--url https://api.helloannie.com/v1/conversations \
--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 = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'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 => [
"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("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("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["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>"
],
"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>"
}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.
curl --request POST \
--url https://api.helloannie.com/v1/conversations \
--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 = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'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 => [
"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("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("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["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>"
],
"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>"
}Body
Request body for creating a new conversation
CHAT, SMS The ID of the bot to use for this conversation
The phone number the conversation is to
Initial messages to seed the conversation. Order is preserved.
Show child attributes
Show child attributes
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.
x >= 1Must be a multiple of 1Optional. Hard maximum for how long the conversation can stay open, measured from creation. Omit to allow the conversation to stay open up to the platform max. Values larger than the platform max are clamped to the platform max.
x >= 1Must be a multiple of 1