bypabloc_
bypabloc_

Reputation: 261

Error: HTTP 400 Unable to create record: Twilio could not find a Channel with the specified From address

I use the credentials that Twilio provides me in the dashboard:

dashboard

Checking that they are the live credentials:

tokens

I also check that the number I want to use is the one that is confirmed in sandbox.

sandbox

I have the following code snippet:

$twilio_number = "+51XXXXXX618";
$client = new \Twilio\Rest\Client(
    'account_sid',
    'auth_token'
);
$message = $client->messages->create(
    "whatsapp:+51XXXXXX148",
    [
        // "from" => "whatsapp:+14155238886",
        "from" => "whatsapp:".$twilio_number,
        "body" => "Prueba de envio de msj"
    ]
);

And I get the following error (code in php):

error

Upvotes: 0

Views: 9174

Answers (1)

philnash
philnash

Reputation: 73075

Twilio developer evangelist here.

In your code you appear to be trying to send a message from the number that starts +51.

That number is a participant in your sandbox, but that means you can send messages to that number, not from it. When you are using the Twilio WhatsApp sandbox you can only send messages from your sandbox number, the one starting +1415.

To move on from the sandbox, you need to follow these instructions to register a number with WhatsApp that you can use for your business.

Upvotes: 1

Related Questions