Retrieve information for a call

A code snippet that shows how to retrieve information for a call. The call to retrieve information for is identified via a UUID.

Example

Replace the following variables in the example code:

KeyDescription
VOICE_CALL_ID

The UUID of the call leg.

Prerequisites

Execute the following command at your terminal prompt to create the JWT for authentication:

export JWT=$(nexmo jwt:generate $PATH_TO_PRIVATE_KEY application_id=$NEXMO_APPLICATION_ID)

Write the code

Add the following to retrieve-info-for-a-call.sh:

curl "https://api.nexmo.com/v1/calls/"$VOICE_CALL_ID \
  -H "Authorization: Bearer $JWT" \

View full source

Run your code

Save this file to your machine and run it:

bash retrieve-info-for-a-call.sh

Try it out

You will need to:

  1. Set up a call and obtain the call UUID. You could use the 'connect an inbound call' code snippet to do this.
  2. Retrieve information for the call (this code snippet).