Nexmo / nexmo-cli

Nexmo CLI (Command Line Interface)
https://nexmo.com
MIT License
78 stars 52 forks source link

Creation of application fails when only messages capability is needed. #222

Closed phoefel closed 3 years ago

phoefel commented 3 years ago

System Configuration

Have latest version of the cli

nexmo -V
0.3.15
node -v
v14.7.0
npm -v
6.14.7

Steps to reproduce

Creation of an application fails on execution of following command 1)

nexmo app:create "WA Trivia App" --capabilities=messages --messages-inbound-url=https://example.com/webhooks/inbound-message --messages-status-url=https://example.com/webhooks/message-status --keyfile=private.key

fails with

error: unknown option `--capabilities'

2) changing the command to

nexmo app:create "WA Trivia App" capabilities "messages" messages-inbound-url "https://example.com/webhooks/inbound-message" messages-status-url "https://example.com/webhooks/message-status" --keyfile=private.key

fails with

home/linuxbrew/.linuxbrew/lib/node_modules/nexmo-cli/lib/response.js:203
        _this9.emitter.list("Application created: ".concat(response.id), response);
                                                                    ^

TypeError: Cannot read property 'id' of null
    at /home/linuxbrew/.linuxbrew/lib/node_modules/nexmo-cli/lib/response.js:203:69
    at HttpClient.__parseResponse (/home/linuxbrew/.linuxbrew/lib/node_modules/nexmo-cli/node_modules/nexmo/lib/HttpClient.js:232:9)
    at IncomingMessage.<anonymous> (/home/linuxbrew/.linuxbrew/lib/node_modules/nexmo-cli/node_modules/nexmo/lib/HttpClient.js:141:19)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1244:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

No application gets created. Since Nexmo documention is all over the place can you either provide the correct variant to the above command or fix the underlying issue in the cli.

lornajane commented 3 years ago

The messages functionality is only available in the beta version of the API. I would love to know if we missed this (rather important) detail from our docs, looking at https://developer.nexmo.com/messages/tutorials/send-sms-with-messages/prerequisites it does have the Beta API there, was there somewhere else where it is missing?

Please let us know if using the beta version of the API gives better results? Hope that helps!

phoefel commented 3 years ago

yes , my fault . In my earlier experiments had hit into an issue with the beta cli and had switched to stable release for that (and then forgot about that !).

yes the issue does not exist when using the beta cli , which docs clearly mention to use !