I’m trying to send an outbound WhatsApp Message using the code in this twilio docs https://www.twilio.com/docs/flex/developer/conversations/send-outbound-messages-via-sms-and-whatsapp#outbound-whatsapp
My code is exactly the same as the example the only different is I changed parameters.
Here is the code:
$interaction = $this->client->flexApi->v1->interaction->create(
[
"type" => "whatsapp",
"initiated_by" => "agent",
"properties" => [
"type" => "whatsapp",
],
"participants" => [
[
"address" => "whatsapp:$to",
"proxy_address" => "whatsapp:" . env('OUTBOUND_MX_WHATSAPP_PHONE_NUMBER'),
"type" => "whatsapp",
],
],
], // channel
[
"routing" => [
"properties" => [
"workspace_sid" => env('TWILIO_WORKSPACE_SID'),
"workflow_sid" => env('TWILIO_MX_WORKFLOW_SID'),
"queue_sid" => env('TWILIO_MX_QUEUE_SID'),
"worker_sid" => $worker->sid,
"attributes" => [
"customerName" => "John Doe",
"customerAddress" => "whatsapp:$to",
],
],
],
]
);
But no matter what workflow/queue/worker I used it keeps giving me back this error: [HTTP 400] Unable to create record: Routing is invalid
The Twilio error code is 45008 but that does not yield useful information.
I tried creating an agent initiated conversation via WhatsApp but I got an error instead.
3