AnsweredAssumed Answered

Invalid token using Reporting API with curl command

Question asked by Vitaly Revsin Employee on Aug 14, 2017
Latest reply on Apr 27, 2018 by Chika Emeka-Nweze

I’m trying to generate a user report for AW3.0 but ran into “invalid token” error. I’ve enabled FSS API and the Administrator role in Admin portal for the user generating the token.

 

Here’s the curl command and output. 

 

Command:

curl -ku "dchan:P@ssw0rd" -d "grant_type=urn:hds:oauth:negotiate-client&version=2.1.0&uniqueId=myuid&clientNickname=dchan" -H "X-HCPAW-MANAGEMENT-API-VERSION: 2.1.0" https://hcpaw211.ucp.sglab:8000/login/oauth

 

Token Output:

{"access_token":"XTmRnVQEEVTWYL5vM4Xl615c2GA35+Dxn3zo6AMN2WVvT9gHBsP2D9DzWIp+oVoW7KmfS9nxv8SDmBk7NquV5LOvehNgqKkVLZHdsbFyo+2ypa8NlS5r7FQQH3Ey2RFMtJ9UN6lZ9egg8NibuQKTLpZe0YA73Kc6x5OksU3C3OPKdSDb4frukQstECGqzF4\u003d:iEYEABECAAYFAlmMCiUACgkQRwC2AbksWc9nhQCZAa9IFWefQL/2d5KwpYzVB0JqXRkAoN5Wg5qeoPmjV8jeoZrzZh8KgjQi","token_type":"Bearer","expires_in":86400}

 

 

c:\curl748>curl -kiX POST -T AllUsersQuota.json -H "Accept: application/json" -H "Authorization:Bear

er XTmRnVQEEVTWYL5vM4Xl615c2GA35+Dxn3zo6AMN2WVvT9gHBsP2D9DzWIp+oVoW7KmfS9nxv8SDmBk7NquV5LOvehNgqKkVLZHdsbFyo+2ypa8NlS5r7FQQH3Ey2RFMtJ9UN6lZ9egg8NibuQKTLpZe0YA73Kc6x5OksU3C3OPKdSDb4frukQstECGqzF4=" -H "X-HCPAW-MANAGEMENT-API-VERSION: 2.1.0" -H "X-HCPAW-DEVICE-ID:myuid" "https://hcpaw211.ucp.sglab:800

0/mapi/report/admin/user/storage"

HTTP/1.1 401 Unauthorized

X-HCPAW-SUPPORTED-MANAGEMENT-API-VERSIONS: 2.1.0

X-HCPAW-MANAGEMENT-API-VERSION: 2.1.0

X-HCPAW-System-Id: 0587ab88-f15b-4c9a-8b6c-1f78d809318d

WWW-Authenticate: Negotiate

Content-Type: application/json;charset=UTF-8

Content-Length: 25

Date: Thu, 10 Aug 2017 07:28:59 GMT

Connection: close

Server: hcpaw

 

{"error":"invalid_token"}

Outcomes