- Community Home
- >
- Storage
- >
- Midrange and Enterprise Storage
- >
- HPE Primera Storage
- >
- REST API response error
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 02:54 AM - last edited on 03-28-2025 02:44 AM by support_s
03-24-2025 02:54 AM - last edited on 03-28-2025 02:44 AM by support_s
Hi,
Is anyone can see what is the problem when I trying to execute the curl command to get the CPG's on the Primera storage? Got the key from successful POST method using my user and password as Header then when i try to use the key to get the CPG's info I got invalid session key.
% showwsapi
-Service- -State- HTTPS_Port -Version- ----------API_URL----------
Enabled Active 443 1.10.0 https://PRIMERA_IPADDRESS/api/v1
See curl command and error below:
curl -k -i -X GET -H "X-HP3PAR-WSAPI-SessionKey: 0-eb6507cde8a2fb82cc579ce1a5d55398-2a1ce167" \
> https://PRIMERA_IPADDRESS/api/v1/cpgs
HTTP/2 403
cache-control: no-cache, no-store, private, max-age=-1, must-revalidate
content-language: en-US
content-security-policy: default-src 'self' https://www.google-analytics.com/ ; script-src 'unsafe-eval' 'self' https://www.googletagmanager.com/gtag/js https://www.google-analytics.com/analytics.js 'sha256-v0Q8X6xSNmwWcfldSEWqW+3imFpJurfHYdywm3hw6+w=' ; style-src 'nonce-d29tZSBjb29sIHN0cmluZyB3aWxsIHBvcCB1cCAxMjM=' 'self' blob:; frame-src 'self'; object-src 'self'; media-src 'self' data: blob:; font-src 'self' data:; frame-ancestors 'self'
content-type: application/json
pragma: no-cache
server: hp3par-wsapi
strict-transport-security: max-age=31536000; includeSubDomains;
vary: Accept-Encoding
vary: Origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
content-length: 39
{"code":6,"desc":"invalid session key"}
Solved! Go to Solution.
- Tags:
- 3PAR StoreServe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 03:55 AM
03-24-2025 03:55 AM
Query: REST API response error
System recommended content:
1. HPE XP Common Services REST API Reference Guide (10.9.3)
Please click on "Thumbs Up/Kudo" icon to give a "Kudo".
Thank you for being a HPE valuable community member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 02:40 AM
03-25-2025 02:40 AM
Re: Query: REST API response error
thanks but still could not get what is wrong in my syntax above as I am using the latest key generated using put method. the documentation is for HPE XP still confusing to me.
Is there any idea on what will be the correct syntax base on my error above?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 04:26 AM
03-26-2025 04:26 AM
SolutionHi Raysa123,
I assume, the correct session key is used.
curl -k -H 'Content-Type:application/json' --data '{ "user":"username" ,"password":"user_password"}' -X POST https://<array ip>/api/v1/credentials {"key":"0-5a2d2c9b9ec72c42c5dd0cf1b544c226-19dec165"}
Fetch the session key from above output and use it with the key name " X-HP3PAR-WSAPI-SessionKey "
Try the below command:
curl -ki https://PRIMERA_IPADDRESS/api/v1/cpgs X GET -H "X-HP3PAR-WSAPI-SessionKey":"<session key from above output>"
Regards,
Veeyaarvi
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 06:17 AM
03-26-2025 06:17 AM
Re: REST API response error
Hi @veeyarvi ,
You provide the right syntax! thanks a lot for sharing.
By the way is it possible to fetch or query a specific key to display the value from the response body? For example i want to monitor only the Primera system "freeCapacityMiB" from the output of this endpoint "/api/v1/system'. Hope you could extend your kindness for a little more if you know something about it.
below is my example result using this endpoint "/api/v1/system'.
curl -k https://<not revealing IPAddr>/api/v1/system?query="name" -X GET -H "X-HP3PAR-WSAPI-SessionKey":"0-f288cbcf927e53fa0ccd9a4afd41ae6b-7feee367"
{"code":9,"desc":"unsupported operation for the resource"}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 08:08 AM
03-26-2025 08:08 AM
Re: REST API response error
Hi Raysa321,
I do not think 'freeCapacityMiB' is a supported one. As per Success | HPE Alletra 9000: Web Services API v1.10 developer reference , I could see 'freeMiB' and 'freeInitializedMiB' might be the one you are looking for (as per requirement).
Regards,
Veeyaarvi
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2025 10:26 AM
03-26-2025 10:26 AM
Re: REST API response error
would you help what is the correct query? i tried it the one i showed above but it returns an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 01:44 AM
03-28-2025 01:44 AM
Re: REST API response error
Hi Raysa,
The below will list the complete endpoint
key=$(curl -k -H 'Content-Type:application/json' --data '{ "user":"username" ,"password":"password"}' -X POST IP address/api/v1/credentials | jq -r '.key'); curl -k -H "Accept:application/json" -H "Content-Type:application/json" -H "X-HP3PAR-WSAPI-SessionKey":"$key" IP Address/api/v1/system | jq -r
I think jq has options to fileter the required output (only) but I am yet to explore that option.
Regards,
Veeyaarvi
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2025 04:44 AM
03-30-2025 04:44 AM
Re: REST API response error
this is a great help. appreciate the assistance and thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 10:21 PM
03-31-2025 10:21 PM
Query: REST API response error
Hello,
Let us know if you were able to resolve the issue.
If you are satisfied with the answers then kindly click the "Accept As Solution" button for the most helpful response so that it is beneficial to all community members.
Please click on "Thumbs Up/Kudo" icon to give a "Kudo".