nexmo-cli icon indicating copy to clipboard operation
nexmo-cli copied to clipboard

price:country fails

Open sammachin opened this issue 4 years ago • 2 comments

Steps to reproduce

nexmo price:country US

Expected behavior

Returns a Price for SMS to the US

Actual behavior

Got a 404

It seems somewhere in history the pricing API was updated to support multiple types, sms sms-transit and voice, although nexmo-node seems to have been updated this command in the CLI hasn't. Its still a useful command as price:sms and price:voice require a phone number this allows searching by ISO country code eg US, GB etc.

Nexmo CLI v0.3.14

sammachin avatar Mar 17 '20 16:03 sammachin

Thanks for filing this, I'll look into it.

AlexLakatos avatar Mar 17 '20 16:03 AlexLakatos

@AlexLakatos Appears that there is a missing parameter in request.js line 41, the call to getPricing from nexmo

  priceCountry(country_code) {
    this.client.instance().number.getPricing(country_code, this.response.priceCountry.bind(this.response));
  }

the call is passing 2 parameters where as

 get(type, country, callback) {
    return this.options.rest.get(
      Pricing.PATH.replace("{endpoint}", "get-pricing").replace("{type}", type),
      { country },
      callback
    );
  }

in the nexmo-code repo is expecting 3 parameters (type is missing) If you can elaborate that I'll open a pull request and fix it (type should be sms I guess)

efiShtain avatar Oct 20 '20 11:10 efiShtain