Your first API call

Contributors dmp-netapp

You can issue a simple curl command at the CLI to get started using the ONTAP REST API and confirm its availability.

Before you begin

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).

Note 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 username:password string in single quotes.
  1. 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 ""

After you finish

The ONTAP version information is displayed in a JSON format.