Skip to content

Issue with send_conversation_message #83

Open

Description

@emorissettegregoire

Hi folks,
For versions > 1.4.2 when calling the send_conversation_message method

channel_id = "my_channel_id"
to = "my_whatsapp_number"
client = MessageBird::Client.new('MY_ACCESS_KEY')
message = client.send_conversation_message(channel_id, to, type: 'text', content: { text: 'Hello!' })

I receive the following error:

MessageBird::ErrorException: MessageBird::ErrorException
.../gems/ruby-2.7.4/gems/messagebird-rest-3.1.1/lib/messagebird/client.rb:91:in `parse_body' when calling this method.

It is working properly for version <= 1.4.2

Thank you for helping.

Activity

  1. qvrb commented on Mar 7, 2023

    @qvrb

    that error is fixed in 4.0.0 but there's an issue in 4.0.0 with respect to channel_id being passed instead of ChannelId

  2. qvrb commented on Mar 8, 2023

    @qvrb

    if you're stuck on 3.0.0 the issue is that the call expects a hash params.merge but then it calls JSON.parse in the parse_body method which expects a string. So the answer is to override the parse_body

        def parse_body(body)
          json = body.class == String ? body : body.to_json
          super(json)
        end
    
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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