Please download the SDK and documentation from NetApp's development site. Then look for code examples in the src/sample/Data_ONTAP directory in the language you prefer. You want to look for volume-list-info in 7-mode and volume-get-iter for Clustered ONTAP.
Also available from the above site is a tool called zexplorer or ZEDI which generates code.
Finally, you can download WFA, Workflow Automation which include workflows and has a API to call the workflow. Check the communities site for more information.
- Rick -