You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
Activity
qvrb commentedon Mar 7, 2023
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
qvrb commentedon Mar 8, 2023
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