Nexmo / nexmo-cli

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

Error when creating messages applications #204

Closed AlexLakatos closed 4 years ago

AlexLakatos commented 4 years ago

Steps to reproduce

nexmo app:create "Send Receive SMS" YOUR_NGROK_URL/webhooks/inbound-message YOUR_NGROK_URL/webhooks/message-status --keyfile=private.key --type=messages

Expected behavior

It works.

Actual behavior

 /usr/local/lib/node_modules/nexmo-cli/lib/response.js:224
        _this10.emitter.list("Application created: ".concat(response.id), response);
                                                                     ^

TypeError: Cannot read property 'id' of null
    at /usr/local/lib/node_modules/nexmo-cli/lib/response.js:224:70
    at HttpClient.__parseResponse (/usr/local/lib/node_modules/nexmo-cli/node_modules/nexmo/lib/HttpClient.js:187:9)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/nexmo-cli/node_modules/nexmo/lib/HttpClient.js:110:19)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

System configuration

Node version: v10.10.0

NPM version: 6.9.0

Operating system: Mac

AlexLakatos commented 4 years ago

The request fails with payload validations.

{
    "type": "https://developer.nexmo.com/api-errors/application#payload-validation",
    "instance": "klklkjkjlk",
    "title": "Bad Request",
    "detail": "The request failed due to validation errors",
    "invalid_parameters": [
        {
            "name": "capabilities[messages].webhooks[status_url].address",
            "reason": "must be a valid URL"
        },
        {
            "name": "capabilities[messages].webhooks[inbound_url].address",
            "reason": "must be a valid URL"
        }
    ]
}
AlexLakatos commented 4 years ago

Fixed in #205, released in alpha.