Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Send your first WhatsApp template message" from offical docs does not work #88

Open
diaclavijo opened this issue Oct 27, 2023 · 0 comments

Comments

@diaclavijo
Copy link

Following the official tutorial for "Send your first WhatsApp template message". Does not work for Ruby SDK

image

Even using the latest master at the time of writting this. This commit 64bcb3f

It suggest copy and pasting this code

# Create a MessageBird client with the specified ACCESS_KEY.
client = MessageBird::Client.new(KEY)
# Enable conversations whatsapp sandbox feature
#client.enable_feature(MessageBird::Client::CONVERSATIONS_WHATSAPP_SANDBOX_FEATURE)

# Start a conversation
conversation = client.start_conversation('123451234, 'channelId', :type => 'hsm',
    :content => {
        :hsm => {
          :namespace => 'XXXX,
          :templateName => 'support',
          :language => {
            :policy => 'deterministic',
            :code => 'en'
          },
          :params => [
            {:default => 'Roberto'},
            {:default => '123'},
            {:default => 'new coffee machine'},
            {:default => 'MessageBird, Trompenburgstraat 2C, 1079TX Amsterdam'}
          ]
      }
    })

But when that's done it fails with "MessageBird::ServerException: Unknown response from server"

When debugging into the gem the params being sent includes key channel_id with value channelId . If set it correctly, still the code in the gemfile sends the key value with "channel_id" while it should be "channelId" and it returns with error:

0> response.body => "{\"errors\":[{\"code\":9,\"description\":\"'channelId' is a required parameter\",\"parameter\":\"channelId\"}]}\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant