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

Can not send sms messages to a group #25

Closed
ChrisOdeon opened this issue Jan 22, 2019 · 7 comments
Closed

Can not send sms messages to a group #25

ChrisOdeon opened this issue Jan 22, 2019 · 7 comments

Comments

@ChrisOdeon
Copy link

There doesn't seem to be any functionality to send an sms message to a group.

@marcelcorso
Copy link
Contributor

Hey Chris,
Thank you for the issue. I was browsing the docs https://developers.messagebird.com/docs/sms-messaging#send-a-message and there is no way on the public API to send a message to a group.

This client is just handy a wrapper over the http api so I don't think it's a nice idea to implement it here.

A better place to implement this is in a code that uses the client. You request the addresses on the group and iterate them (maybe batch them into recipient lists) and then do the POST to /messages.

I'm closing this now and if you are unsure about the solution let me know!

@ChrisOdeon
Copy link
Author

The array of recipients msisdns. Note: can also contain groupIds. Required

@marcelcorso
Copy link
Contributor

Oh nice! I missed that.

So it works already. Or you think the library should make it easier somehow?

@ChrisOdeon
Copy link
Author

ChrisOdeon commented Jan 24, 2019 via email

@marcelcorso
Copy link
Contributor

marcelcorso commented Jan 24, 2019 via email

@ChrisOdeon
Copy link
Author

It seems as though it does work through the api but doesn't work through this sdk because it requires the parameter groupids instead of recipients.

@marcelcorso
Copy link
Contributor

oh no.

Can you please try the "lower level" request method?

Something like

begin
  client.request(:post, "messages", {:originator => "marcel", :body => "monsters", 'groupIds' => ["a9a4bc87700c44ddb6c483bfc192b921"]})
rescue MessageBird::ErrorException => e
  e.errors.inspect
end

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

2 participants