vonage-node-sdk icon indicating copy to clipboard operation
vonage-node-sdk copied to clipboard

[BETA] "to" and "from" params are in different order between SMS and Messages

Open fauna5 opened this issue 6 years ago • 12 comments

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.

fauna5 avatar Dec 18 '18 14:12 fauna5

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"
      }
    }
  }'

fauna5 avatar Dec 18 '18 14:12 fauna5

@AlexLakatos any thoughts?

fauna5 avatar Jan 08 '19 11:01 fauna5

the api is not order specific, but if it make life easier for you, I can swap them in the next beta

AlexLakatos avatar Jan 08 '19 14:01 AlexLakatos

it would help if I can see usage data from chart.io of the beta user agent and of this endpoint specifically

AlexLakatos avatar Jan 08 '19 14:01 AlexLakatos

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 .

fauna5 avatar Jan 08 '19 15:01 fauna5

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?

fauna5 avatar Jan 08 '19 15:01 fauna5

This is only in the beta channel so we can do a minor version bump

mheap avatar Jan 09 '19 11:01 mheap

Talked to Hugh and got his blessing, looked at usage data and the disruption is minimal, and we can email the affected accounts directly.

AlexLakatos avatar Jan 09 '19 17:01 AlexLakatos

@mheap - Based on the documentation, looks like this was never implemented - is it still an issue, or can we close this?

kellyjandrews avatar Jul 23 '20 14:07 kellyjandrews

Still an issue, but is a breaking change. Push to v3

mheap avatar Jul 24 '20 12:07 mheap

@mheap Wouldn't I be changing the messages beta api?

kellyjandrews avatar Jul 24 '20 13:07 kellyjandrews

Yep. I'm assuming there will be a beta messages module for v3 and we could make the change there

mheap avatar Jul 24 '20 13:07 mheap

@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.

manchuck avatar Nov 22 '22 16:11 manchuck