diff --git a/lib/messagebird/client.rb b/lib/messagebird/client.rb index 5a19b73..205500f 100644 --- a/lib/messagebird/client.rb +++ b/lib/messagebird/client.rb @@ -114,7 +114,7 @@ def start_conversation(to, channel_id, params = {}) :post, 'conversations/start', params.merge(to: to, - channel_id: channel_id) + ChannelId: channel_id) )) end @@ -164,7 +164,7 @@ def conversation_webhook_create(channel_id, url, events = []) ConversationWebhook.new(conversation_request( :post, 'webhooks', - channel_id: channel_id, + ChannelId: channel_id, url: url, events: events )) diff --git a/spec/conversation_spec.rb b/spec/conversation_spec.rb index 463c069..8ebef89 100644 --- a/spec/conversation_spec.rb +++ b/spec/conversation_spec.rb @@ -19,7 +19,7 @@ expect(conversation_client) .to receive(:request) - .with(:post, 'conversations/start', { channel_id: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) + .with(:post, 'conversations/start', { ChannelId: 'c0dae31e440145e094c4708b7d000000', to: 31_612_345_678, type: 'text', content: { text: 'Hi there!' } }) .and_return('{}') client.start_conversation(31_612_345_678, 'c0dae31e440145e094c4708b7d000000', type: 'text', content: { text: 'Hi there!' }) @@ -168,7 +168,7 @@ expect(conversation_client) .to receive(:request) - .with(:post, 'webhooks', { channel_id: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' }) + .with(:post, 'webhooks', { ChannelId: 'channel-id', events: [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED], url: 'url' }) .and_return('{"id":"00000000000000000000000000000000", "events": ["message.created", "message.updated"]}') webhook = client.conversation_webhook_create('channel-id', 'url', [MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_CREATED, MessageBird::Conversation::WEBHOOK_EVENT_MESSAGE_UPDATED])