Your first API call
You can issue a simple curl command at the CLI to get started using the ONTAP REST API and confirm its availability.
The curl utility must be available on your workstation. In addition, you must have the following:
IP address or host name of the ONTAP cluster management LIF
User name and password for an account with authority to access the ONTAP REST API (cluster resource).
If your credentials include special characters, you need to format them in a way that is acceptable to Curl based on the shell you are using. For example, you can insert a backslash before each special character or wrap the entire
At the command line interface of your local workstation, retrieve the version of the ONTAP software:
curl -X GET -u username:password -k "https://<ip_address>/api/cluster?fields=version"
curl -X GET -u admin:password -k "https://10.222.81.101/api/cluster?fields=version"
The ONTAP version information is displayed in a JSON format.