Finish connecting a WhatsApp Business number
POST
/whatsapp/connect
const url = 'https://example.com/whatsapp/connect';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"code":"example","wabaId":"example","phoneNumberId":"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/connect \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "code": "example", "wabaId": "example", "phoneNumberId": "example" }'Takes what Meta’s Embedded Signup gave the browser, swaps the code for the business’s token, and asks Meta to send the number’s messages to Bottle.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
wabaId
required
string
phoneNumberId
required
string
Example generated
{ "code": "example", "wabaId": "example", "phoneNumberId": "example"}Responses
Section titled “Responses”Connected
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" } ]}WhatsApp is not configured on this installation
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}