API query using curl

Use of the API, regardless of the queried route, requires authentication by following this process.

In the code below, the “username” and “password” keywords must respectively be replaced by the values “API access key ID” and “API secret access key” of the credentials previously generated. The same applies to the “url” value, which should be replaced by your Cyberwatch instance IP address.

Basic authentication snippet using Curl

This code allows you to run a login test on your Cyberwatch instance API:

curl -X 'GET' https://url/api/v3/ping -H 'Accept: application/json; charset=utf-8' --user 'access_key:secret_key'

In case the TLS certificate of the Cyberwatch server cannot be recognized by the machine running this command, the curl command also needs to contain the --insecure parameter.

Back to top