Giter Site home page Giter Site logo

Add setup:number about nexmo-cli HOT 14 CLOSED

nexmo avatar nexmo commented on July 30, 2024
Add setup:number

from nexmo-cli.

Comments (14)

sammachin avatar sammachin commented on July 30, 2024

It's the application API might not be in the public docs yet, @leggetter
should be able to point you in the right direction or if he's not sure ask
Roland

On Friday, 6 May 2016, Cristiano Betta [email protected] wrote:

@sammachin https://github.com/sammachin could you clarify what API call
you see this mapping too? I'm having difficulty determining this.

From the doc:

Setup Number
nexmo number:setup $number [app|sms|voicefwd|voicexml]
[app]
-name [$name|$appid]
[sms]
-url $url
[voicefwd]
-address [$e164Num|$sipuri]
-statusurl $statusCallbackURL *optional
[voicexml]
-url $URLofVXML
-statusurl $statusCallbackURL *optional

Sets up the number for either app usage or legacy SMS or Voice service, voice has the option of forwarding to a number/sip URI or to a VoiceXML application.
Note, currently you can setup a number for both app which will configure voice to goto VAPI and then legacy SMS to a URL, however app|voicexml|voicefwd are mutually exclusive


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@leggetter would love some clarification on this. The docs (https://docs.nexmo.com/tools/application-api) only show the basic CRUD as far as I can see.

from nexmo-cli.

leggetter avatar leggetter commented on July 30, 2024

See the section with the para:

Use the following code examples to make a POST request with Developer API and associate the application_id with your virtual number.

https://docs.nexmo.com/tools/application-api#apps_quickstart

Is that what you're after?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@leggetter Not really. Isn't that the app:create function in the CLI docs?

from nexmo-cli.

leggetter avatar leggetter commented on July 30, 2024

Use the following code examples to make a POST request with Developer API and associate the application_id with your virtual number.

#!/bin/bash

base_url='https://rest.nexmo.com'
version=''
action='/number/update'
application_id='APPLICATION_ID'
key='API_KEY'
secret='API_SECRET'
country='XX'
msisdn='441632960960'

curl -X POST $base_url$version$action \
-d api_key=$key \
-d api_secret=$secret \
-d country=$country \
-d msisdn=$msisdn \
-d voiceCallbackType='app' \
-d voiceCallbackValue=$application_id

As per the text, this is used to associate a number with an app. Isn't that what we're trying to do here?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@leggetter I think I'm starting to get it. All of the number:setup calls reflect the number->update API.

https://docs.nexmo.com/tools/developer-api/number-update

So let's rewrite this:

nexmo number:setup $number [app|sms|voicefwd|voicexml]
[app]
-name [$name|$appid]
[sms]
    -url $url 
[voicefwd]
    -address [$e164Num|$sipuri]
    -statusurl $statusCallbackURL *optional
[voicexml]
-url $URLofVXML
    -statusurl $statusCallbackURL *optional

As:

nexmo number:update app <number> <app_id>
nexmo number:update sip <???>
nexmo number:update tel <???>
nexmo number:update vxml <???>

As I'm not quite familiar yet with Nexmo, can someone explain to me what the relevant params are for the sip, tel, and vxml types? I've read the docs but it's not made things clearer. It's hard to tell what's required for which type.

from nexmo-cli.

leggetter avatar leggetter commented on July 30, 2024

Do we assign a number to an app or an app to a number?

To me it feels like you have a number and you then assign it to an application.

nexmo app:add-number <app_id> <number>

But... A number can only be associated with one app. In fact, we have an idea of number pools where you can create number pools and assign a pool to a number. But there is still some work going on in this space.

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@leggetter honestly no idea. You're the expert :). I'd say a number can be assigned to a few things. This is what the API suggests. So specifying what the number belongs to on the number level might make more sense (and is what the API does, I think). Honestly it's all up to you and what you want. I'd be happy to do either but need some clarity.

from nexmo-cli.

leggetter avatar leggetter commented on July 30, 2024

I'm certainly no expert.

Based on a conversation from just over a week ago the docs stating application_type is actually wrong. Apps (will) have different capabilities. A voice is the the only capability right now.

Apps can then have number pools (groups of numbers) associated with them. Or you could say that an app has number pools associated with it. I don't believe we expose number pools right now. So associating single numbers is the best we can do, and I think that's fine for now.

So both

  1. app:add-number <app_id> <number>
  2. number:update <number> <app_id>

may be valid.

My vote would be for 1. @sammachin - what do you think?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@sammachin thoughts on this?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

I've been thinking:

nexmo link <number> <app_id>
nexmo unlink <number>

That seems the most elegant way to me for now. Does that work?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

Down the line we can make this backwards compatible like this:

nexmo link <number> <xid> --type <type>

Where type is by default app?

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

@leggetter @sammachin I got the nexmo link working using the updateNumber() API. Any idea how to unlink an app from a number? I tried setting voiceCallbackType to null or a blank string but no luck.

from nexmo-cli.

cbetta avatar cbetta commented on July 30, 2024

Ok @sammachin confirmed this is probably not possible yet.

Have release this for now as a simple nexmo link <number> <app_id>.

from nexmo-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.