Change how Bottle handles WhatsApp messages
PATCH
/whatsapp
const url = 'https://example.com/whatsapp';const options = { method: 'PATCH', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"createDrafts":true,"replyToCustomers":true,"answerQuestions":true,"allowReschedule":true,"allowCancel":true,"placeWhenConfirmed":true,"onlyTrialPhones":true,"trialPhones":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/whatsapp \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "createDrafts": true, "replyToCustomers": true, "answerQuestions": true, "allowReschedule": true, "allowCancel": true, "placeWhenConfirmed": true, "onlyTrialPhones": true, "trialPhones": [ "example" ] }'Whether it makes draft orders, whether it replies to check them, and whether it only reads messages from a few numbers while you try it.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
createDrafts
boolean
replyToCustomers
boolean
answerQuestions
boolean
allowReschedule
boolean
allowCancel
boolean
placeWhenConfirmed
boolean
onlyTrialPhones
boolean
trialPhones
Array<string>
Example generated
{ "createDrafts": true, "replyToCustomers": true, "answerQuestions": true, "allowReschedule": true, "allowCancel": true, "placeWhenConfirmed": true, "onlyTrialPhones": true, "trialPhones": [ "example" ]}Responses
Section titled “Responses”The connection
Media typeapplication/json
object
status
required
string
signup
required
object
appId
required
string
configId
required
string
displayPhone
required
string | null
verifiedName
required
string | null
createDrafts
required
boolean
replyToCustomers
required
boolean
answerQuestions
required
boolean
allowReschedule
required
boolean
allowCancel
required
boolean
placeWhenConfirmed
required
boolean
onlyTrialPhones
required
boolean
trialPhones
required
Array<string>
lastMessageAt
required
string | null format: date-time
lastError
required
string | null
Example
{ "status": "off"}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" } ]}