Install the CLI

$ npm install -g nexmo-cli

Create an application

Once you have the CLI installed you can use it to create a Nexmo application. Run the following command and make a note of the application ID that it returns. This is the value to use in NEXMO_APPLICATION_ID in the example below. It will also create private.key in the current directory which you will need in the Initialize your dependencies step

Nexmo needs to connect to your local machine to access your answer_url. We recommend using ngrok to do this. Make sure to change demo.ngrok.io in the examples below to your own ngrok URL.

Install dependencies

Initialize your dependencies

Write the code

Add the following to app.js:

Copy to Clipboard

constonInboundCall=(request,response)=>{constfrom=request.query.fromconstfromSplitIntoCharacters=from.split('').join(' ')constncco=[{action:'talk',text:`Thank you for calling from ${fromSplitIntoCharacters}`}]response.json(ncco)}app.get('/webhooks/answer',onInboundCall)

Install the CLI

$ npm install -g nexmo-cli

Create an application

Once you have the CLI installed you can use it to create a Nexmo application. Run the following command and make a note of the application ID that it returns. This is the value to use in NEXMO_APPLICATION_ID in the example below. It will also create private.key in the current directory which you will need in the Initialize your dependencies step

Nexmo needs to connect to your local machine to access your answer_url. We recommend using ngrok to do this. Make sure to change demo.ngrok.io in the examples below to your own ngrok URL.

Install the CLI

$ npm install -g nexmo-cli

Create an application

Once you have the CLI installed you can use it to create a Nexmo application. Run the following command and make a note of the application ID that it returns. This is the value to use in NEXMO_APPLICATION_ID in the example below. It will also create private.key in the current directory which you will need in the Initialize your dependencies step

Nexmo needs to connect to your local machine to access your answer_url. We recommend using ngrok to do this. Make sure to change demo.ngrok.io in the examples below to your own ngrok URL.

Install dependencies

$ composer require slim/slim:^3.8

Write the code

Add the following to index.php:

Copy to Clipboard

$app=new\Slim\App;$app->get('/webhooks/answer',function(Request$request,Response$response){$params=$request->getQueryParams();$fromSplitIntoCharacters=implode(" ",str_split($params['from']));$ncco=[['action'=>'talk','text'=>'Thank you for calling from '.$fromSplitIntoCharacters]];return$response->withJson($ncco);});$app->run();

Install the CLI

$ npm install -g nexmo-cli

Create an application

Once you have the CLI installed you can use it to create a Nexmo application. Run the following command and make a note of the application ID that it returns. This is the value to use in NEXMO_APPLICATION_ID in the example below. It will also create private.key in the current directory which you will need in the Initialize your dependencies step

Nexmo needs to connect to your local machine to access your answer_url. We recommend using ngrok to do this. Make sure to change demo.ngrok.io in the examples below to your own ngrok URL.

Initialize your dependencies

Write the code

Add the following to receive-an-inbound-call.py:

Copy to Clipboard

@app.route("/webhooks/answer")defanswer_call():forparam_key,param_valueinrequest.args.items():print("{}: {}".format(param_key,param_value))from_=request.args['from']returnjsonify([{"action":"talk","text":"Thank you for calling from "+" ".join(from_)}])

Install the CLI

$ npm install -g nexmo-cli

Create an application

Once you have the CLI installed you can use it to create a Nexmo application. Run the following command and make a note of the application ID that it returns. This is the value to use in NEXMO_APPLICATION_ID in the example below. It will also create private.key in the current directory which you will need in the Initialize your dependencies step

Nexmo needs to connect to your local machine to access your answer_url. We recommend using ngrok to do this. Make sure to change demo.ngrok.io in the examples below to your own ngrok URL.

Write the code

Add the following to inbound_tts_call.rb:

Copy to Clipboard

route:get,:post,'/webhooks/answer'dofrom=params['from']||parsed_body['from']from_split_into_characters=from.split('').join(' ')[{action: 'talk',text: "Thank you for calling from #{from_split_into_characters}"}].to_jsonendset:port,3000