Skip to content

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

@diaclavijo

Description

@diaclavijo

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions