2

I'm trying to follow this guide to start business initiated conversation in WhatsApp. I successfully created the user in the first step, but I cannot link it to the WhatsApp channel.

I'm calling API POST request:

https://api.smooch.io/v1.1/apps/{myAppID}/appusers/{myUserID}/channels

With body:

{
    "type":"whatsapp",
    "confirmation":{"type":"immediate"},
    "phoneNumber":"phoneNumberInInternationalFormat"
}

But result is:

{
    "error": {
        "code": "bad_request",
        "description": "Linking not supported for whatsapp sandbox integrations."
    }
}

So my question - is there any way to send a message using Sandbox number, or I need to register a number by requesting access process?

1 Answers1

1

The linking API is disabled in Sandbox mode, but you can still send and receive messages from the phone number you used to set up the sandbox. Just send a message to the sandbox number and it will automatically create a user in your Smooch App. Then, you can use the API or business system integrations to reply just as you would with any other user.

See also the section on user-initiated conversations in the WhatsApp guide

mspensieri
  • 3,501
  • 15
  • 18
  • Thanks for the reply. Could you clarify how should I get the ID of the automatically created user? – Alexander Shestakov Oct 31 '18 at 14:04
  • You can see it in the Logs tab of the Smooch dashboard, or if you have a webhook configured for the `message:appUser` trigger, the payload you receive will include the user's ID – mspensieri Nov 01 '18 at 12:34
  • Thanks, I've already found out it! My mistake was that I was trying to send messages to my number which I've bound, instead of Smooch sandbox number. – Alexander Shestakov Nov 02 '18 at 07:50
  • Also maybe it is a wrong place to ask, but during the period my personal number have been bound to sandbox, I was not able to receive any calls or SMS. I also didn't found any warnings about such behaviour. Is that expected? – Alexander Shestakov Nov 02 '18 at 07:54
  • No it's not expected. The only thing setting up the sandbox does is store your number on Smooch's side, it doesn't affect any behaviour of your device at all – mspensieri Nov 03 '18 at 14:20