vonage-node-sdk
vonage-node-sdk copied to clipboard
[BETA] "to" and "from" params are in different order between SMS and Messages
Send a text message
nexmo.message.sendSms(sender, recipient, message, options, callback);
Send a Messages API message
function send(to, from, message, callback)
As they are not named parameters then it's easy to get mixed up. Should we swap then? Will it cause a lot of pain for exiting users.
I also note that the HTTP API lists from
first:
curl -X POST https://api.nexmo.com/v0.1/messages \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"from": { "type": "sms", "number": "Nexmo" },
"to": { "type": "sms", "number": "441234567890" },
"message": {
"content": {
"type": "text",
"text": "Hello from Nexmo"
}
}
}'
@AlexLakatos any thoughts?
the api is not order specific, but if it make life easier for you, I can swap them in the next beta
it would help if I can see usage data from chart.io of the beta user agent and of this endpoint specifically
There's no data in chart.io for the user agent :(
On Tue, Jan 8, 2019 at 2:55 PM Alex Lakatos [email protected] wrote:
it would help if I can see usage data from chart.io of the beta user agent and of this endpoint specifically
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Nexmo/nexmo-node/issues/233#issuecomment-452326757, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0HhY0lP3KrwxgQnh6S09yjEuqa-A0Yks5vBLFRgaJpZM4ZYXE0 .
It confused us twice so far, so it'd be good to swap. I'll send a PR. We will need to communicate this to existing customers. How do we do that? Should it be a major version bump too?
This is only in the beta channel so we can do a minor version bump
Talked to Hugh and got his blessing, looked at usage data and the disruption is minimal, and we can email the affected accounts directly.
@mheap - Based on the documentation, looks like this was never implemented - is it still an issue, or can we close this?
Still an issue, but is a breaking change. Push to v3
@mheap Wouldn't I be changing the messages beta api?
Yep. I'm assuming there will be a beta messages module for v3 and we could make the change there
@fauna5 Version 3 of the SDK was deployed, and sending an SMS now requires an SMS Parameters object to be passed instead. You can install @vonage/sms
or update the latest SDK to try it out. FYI that V3 of the SDK is all async
now, so the uplift might be a lot.