-
To make individual REST calls to the HPE OneView API, you will need to install a REST-client extension (add-on or plug-in) into your web-browser.
To install the client, visit your browser's Tools, Add-ons, or Extensions page to search for, download, and install the appropriate extension. For example, you could install REST Client for the Firefox browser, or Advanced REST Clientor Postman for the Chrome browser.
Starting to work with REST APIs
-
Once the extension is installed, re-start your browser and browse to the HPE OneView login-screen as you normally would.
![[IMPORTANT: ]](images/important.gif)
IMPORTANT: Be sure to accept the security exception (certificate) or the browser will block further requests.
-
Open a new tab in the same browser, and start your REST-client extension.
-
Make your first REST-call a
GETrequest. Enter the appliance URL and press SEND.https://192.168.1.101/
You should receive a
200(OK)response and some text.If you receive a
0status instead, check that you accepted the certificate as noted in step 1. -
Make your second REST-call an operation to get your Session-ID for subsequent operations.
-
Add the following two
http-headers to your request:Content-type: application/json Accept: application/json
-
Add the text-body (RAW-text) with a valid username and password.
{"userName":"administrator","password":"mypassword"} -
https://192.168.1.101/rest/login-sessions
You should receive a
200 OKstatus and a sessionID similar to the following:{ "sessionID": "2zCmY9frjiYp1XIzsCiu2H1EjUgmcy08" }If you receive a
403 (Forbidden)response, check that your credential is valid. -
-
Add a third header with your new sessionID.
-
Auth: 2zCmY9frjiYp1XIzsCiu2H1EjUgmcy08
-
https://192.168.1.101/rest/version
You should receive the appliance version.
{ "minimumVersion": 1, "currentVersion": 120 }See the HPE OneView REST API Reference for additional requests and additional header requirements.
-
![[NOTE: ]](images/note.gif)