Reply to a customer on WhatsApp
POST
/whatsapp/conversations/{id}/messages
const url = 'https://example.com/whatsapp/conversations/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/messages';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"text":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/whatsapp/conversations/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/messages \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "text": "example" }'Sends the text from the business’s WhatsApp number, as a reply typed on the phone would be. WhatsApp only allows it within 24 hours of the customer’s last message. Once somebody has replied, Bottle stays out of the conversation unless there is an order or a question.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Body
Section titled “Request Body”Media typeapplication/json
object
text
required
string
Example generated
{ "text": "example"}Responses
Section titled “Responses”The conversation, with the reply in it
Media typeapplication/json
object
id
required
UUID v7
string format: uuid
contactPhone
required
string
profileName
required
string | null
status
required
string
customer
required
object
id
required
UUID v7
string format: uuid
name
required
string
customerChosen
required
boolean
candidates
required
Array<object>
object
id
required
UUID v7
string format: uuid
name
required
string
orderId
required
UUID v7
string | null format: uuid
summary
required
string | null
lines
required
Array<object>
object
productId
required
UUID v7
string | null format: uuid
productName
required
string | null
quantity
required
integer
said
required
string
reason
required
string | null
unsure
required
Array<string>
orderConfirmed
required
boolean
addressConfirmed
required
boolean
empties
required
object
answer
required
string | null
count
required
integer | null
waitingFor
required
string | null
failed
required
boolean
bottleReplying
required
boolean
messages
required
Array<object>
object
id
required
UUID v7
string format: uuid
direction
required
string
kind
required
string
body
required
string | null
translation
required
string | null
sentByBottle
required
boolean
buttons
required
Array<string> | null
sentAt
required
string format: date-time
lastMessageAt
required
string format: date-time
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "status": "waiting", "customer": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }, "candidates": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "orderId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "lines": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "empties": { "answer": "yes" }, "waitingFor": "address", "messages": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "direction": "in" } ]}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not found
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Conflicts with how things are now
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}