V-Spark Online Help

Using the /search API with cURL

The cURL utility makes it easy to test using the V‑Spark API by providing a command-line mechanism for invoking APIs. The next few sections provide examples of using the GET, POST, and DELETE output types with a V‑Spark API from the command line via the cURL command.

If you are unfamiliar with the cURL command, see Using cURL for REST API Testing for a short introduction and an explanation of how cURL examples are displayed. See Tips for Debugging and Managing cURL Calls for suggestions about how to debug and manage cURL calls.

The following is a cURL example that shows calling the /search API using the GET method, which supplies the /search parameters as options on the URL:

curl 'http://example.company.com/search/Test/Test-Testing/Test01? \
     token=0123456789abcdef0123456789abcdef&duration=4:30-5:30'

The following is a cURL example that shows calling the /search API using the POST method.

curl \
     -H 'Content-type: application/json' \
     -d '{"daterange":"20190613-20190614"}' \
     -X POST 'https://example.company.com/search/Test/Test-Testing/CallCenterDemosTest01?token=1234567890abcdefghijk1234567890a'

The -d flag provides a date range for the search as JSON-format data.