‎21-08-2019 10:36 PM
Hello,
We are trying to test the API features to generate reports.
However, it seems we can't even pass the login phase...
All is configured according to the exemple, but looking at the logs we saw that :
2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Start token request 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Start client validation 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Start parsing Basic Authentication secret 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Start parsing for secret in post body 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - No secret in post body found 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Start parsing for X.509 certificate 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - client_id is not found in post body 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Parser found no secret 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - No client secret found 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - End token request 2019-08-21 16:27:20,449 [64] INFO /LM/W3SVC/1/ROOT/UAS-1-132108916563800795 - System.Reflection.RuntimeAssembly - Returning error: invalid_client
No secret in post body ?
No client_id in post body??
Config in wwwroot\UAS\config.json
"HopexAPI": { "Enabled": 1, "Flow": 4, "ClientId": "HopexAPI", "Scopes": "read;write;offline_access;openid", "ClientSecret": "secret", "ClientName": "Hopex WebServices"
Result and poke with PostMan
Any idea ?
Thanks a lot,
Raphaël.
‎05-12-2019 08:34 PM - edited ‎05-12-2019 08:34 PM
Hello,
Thanks for the reply but unfortunately it is exactly what I have (see screenshots).
Would you have any other clue ?
Thanks
‎27-11-2019 08:08 PM
‎27-11-2019 08:07 PM
Before making any call to a REST API in HOPEX you need to get an authentication bearer token. This token will allow you to access the data based on your credentials. Prior to continue make sure you have at leat the there following information :
To get a token make a REST API call to the following URL
https://<<my server here>>/UAS/connect/token
You can make this call with a tool like Postman for instance. the request will be a POST request to which you will provide a set of parameters in the body.
Selection for the body option : x-www-form-urlencoded
The parametes for the body are :
grant_type: password (remove the space between the : and the p)
scope:hopex openid read write
username:<<my hopex login here>>
password:<<my hopex password here>>
client_id:HopexAPI
client_secret:secret
environmentId:<<my hopex environment absolute identifier>>
Need to know how to get the environmentID ? Read this post
Some of the option can be different than in this example depending on the installation option you have done.
Body Response format :
https://community.mega.com/t5/REST-API/Get-a-bearer-token-from-UAS-for-REST-API-call/m-p/21372#M2
‎27-11-2019 06:22 PM
Hi.
We want to use Web APIs. Could you please link us to the example you are talking about? I can't find how to configure the API user.
Thanks.