Get specific records by UUID
This code snippet shows you how to retrieve a specific record by specifying a message or call UUID. It is also possible to specify a comma-separated list of UUIDs to retrieve multiple records, for example:
If records corresponding to any of the specified UUIDs are not found, then a list of those are returned in the response using the ids_not_found field, for example:
NOTE: This is a synchronous call and so will block until it returns a response.
Example
| Key | Description |
|---|---|
VONAGE_API_KEY | Your Vonage API key (see it on your dashboard). |
VONAGE_API_SECRET | Your Vonage API secret (also available on your dashboard). |
ACCOUNT_ID | The account ID (same as |
REPORT_DIRECTION | Either |
REPORT_PRODUCT | Specifies the product for which reports and records are obtained. Can be one of |
ID | The UUID of the message or call to retrieve a record for. It is possible to specify a comma-separated list of UUIDs to retrieve multiple records. |
Run your code
Save this file to your machine and run it:
Try it out
Set the replaceable variables for your account.
For this example, set
REPORT_PRODUCTtoSMS.Using the table as a guide set values for the remaining variables.
Run the script and you receive a response similar to the following: