mo_zaidan 0 Posted August 27, 2020 Share Posted August 27, 2020 Hallo, ich habe das Problem Code 401, Error: Unauthorized nicht lösen kann. Ich sende eine Abfrage mit helfe der MSP API2, um einen Report zu rufen. Das Problem, dass ich immer folgende Fehler bekomme(Error: Unauthorized). Laut (https://help.eset.com/ema/2/api/en-US/search_licenses.html?troubleshooting_api.html) ich muss den Token neu rufen oder Aktuelleren aber das bringt keine Verbesserung. Ich habe auch mit EMA2 API (swagger UI) und einen Curl auf Linux aber ich habe das gleiche Problem. Ich führe den folgenden Befehl: curl -X GET "https://mspapi.eset.com/api/User/Current" -H "accept: application/json" -H "Authorization: ---Authorization-TOKEN----" Um die Details dem Benutzer anzuzeigen, aber funktioniert auch nicht, immer mit dem Fehler (401 Error:Unauthorized). Kann jemand mir helfen? Vielen Dank im Voraus. Link to comment Share on other sites More sharing options...
ESET Staff MichalJ 434 Posted August 28, 2020 ESET Staff Share Posted August 28, 2020 Hello @mo_zaidan would it be possible to post in English? I would then ask my colleagues who have better experience with the API to check. Link to comment Share on other sites More sharing options...
mo_zaidan 0 Posted August 31, 2020 Author Share Posted August 31, 2020 On 8/28/2020 at 4:14 PM, MichalJ said: Hello @mo_zaidan would it be possible to post in English? I would then ask my colleagues who have better experience with the API to check. Hello,I have the problem ( Code 401, Error: Unauthorized ) cannot solve.I send a query using the MSP API2 to call a report. The problem that I always get the following errors (Error: Unauthorized).According to (https://help.eset.com/ema/2/api/en-US/search_licenses.html?troubleshooting_api.html) I have to call the token again or refresh it but that doesn't bring any solution.I've also been using EMA2 API (swagger UI) and a curl on Linux but I'm having the same problem.I run the following command: curl -X GET "https://mspapi.eset.com/api/User/Current" -H "accept: application / json" -H "Authorization: --- Authorization-TOKEN ----" To show the user details, but also does not work, always with the error (401 Error: Unauthorized).Can anyone help me?Thanks. Link to comment Share on other sites More sharing options...
ESET Staff Kvako 2 Posted August 31, 2020 ESET Staff Share Posted August 31, 2020 Hi, You're almost there, just need to put a single word Bearer in front of the access token (separated by a space) When using swagger - after you receive an access token, you can Authorize by clicking Authorize button on the top with Bearer {{----token----}} written into text field Using API directly, your call should look like this curl -X GET "https://mspapi.eset.com/api/User/Current" -H "accept: application/json" -H "Authorization: Bearer eyJgbGciOiJSUzI1NiIsImtpZCI6ImU1WTdkMGJEUGtORmFDV094VWlBaUU5MDBDbyIsInR5cCI6IkpXVCIsIng1dCI6ImU1WTdkMGJEUGtORmFDV094VWlBaUU5MDBDbyJ9.eyJuYmYiOjE1OTg4NTk1NDUsImV4cCI6MTU5ODg1OTYwNSwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5lc2V0LmNvbSIsImF1ZCI6WyJodHRwczovL2lkZW50aXR5LmVzZXQuY29tL3Jlc291cmNlcyIsImVtYTJfYXBpIl0sImNsaWVudF9pZCI6IkVzZXQuRU1BLkFQSSIsInN1YiI6IjFjZmFkZTliLggiODUtNGU5Mi04Zjc0LTZhMTY4ZGEzYjdhNyIsImF1dGhfdGltZSI6MTU5ODg1OTU0NSwiaWRwIjoibG9jYWwiLCJzY29wZSI6WyJlbWEyX2FwaSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJjdXN0b20iXX0.sG65OnNxQsstp5Su_Da-i9b25Q3SO_dU4va3IvdRU4m2s7jQ6zm6MqR_JV8d2E4B23HTKuwTl6XJvsVNMtL6KrggrJVmbPkgmR64XodNOtnrfnHtL_dPUy6cmbTMgjdeMGhUMZLKCauj60uK2nLyJbQKVU_VTj5E1eew0G4q3tIAnFtgNlJ3SHD_YAhNoet4Wu7b-dXLKlpFlmvjav1sXp-iSjUxDLS2rjcmNfMqRdW3C1lXL58daKZx3xGkoPSSMXAK7tPJEreFOepPeon-u5JuPqy5fIc1XJ7VDX60arqa7Ejq3z34tbj2vABJ6Qx3M7e1jRZF7v-7Bye0J-jSjVF" Thank you, Martin MichalJ and mo_zaidan 2 Link to comment Share on other sites More sharing options...
mo_zaidan 0 Posted September 3, 2020 Author Share Posted September 3, 2020 On 8/31/2020 at 9:48 AM, Kvako said: Hi, You're almost there, just need to put a single word Bearer in front of the access token (separated by a space) When using swagger - after you receive an access token, you can Authorize by clicking Authorize button on the top with Bearer {{----token----}} written into text field Using API directly, your call should look like this curl -X GET "https://mspapi.eset.com/api/User/Current" -H "accept: application/json" -H "Authorization: Bearer eyJgbGciOiJSUzI1NiIsImtpZCI6ImU1WTdkMGJEUGtORmFDV094VWlBaUU5MDBDbyIsInR5cCI6IkpXVCIsIng1dCI6ImU1WTdkMGJEUGtORmFDV094VWlBaUU5MDBDbyJ9.eyJuYmYiOjE1OTg4NTk1NDUsImV4cCI6MTU5ODg1OTYwNSwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5lc2V0LmNvbSIsImF1ZCI6WyJodHRwczovL2lkZW50aXR5LmVzZXQuY29tL3Jlc291cmNlcyIsImVtYTJfYXBpIl0sImNsaWVudF9pZCI6IkVzZXQuRU1BLkFQSSIsInN1YiI6IjFjZmFkZTliLggiODUtNGU5Mi04Zjc0LTZhMTY4ZGEzYjdhNyIsImF1dGhfdGltZSI6MTU5ODg1OTU0NSwiaWRwIjoibG9jYWwiLCJzY29wZSI6WyJlbWEyX2FwaSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJjdXN0b20iXX0.sG65OnNxQsstp5Su_Da-i9b25Q3SO_dU4va3IvdRU4m2s7jQ6zm6MqR_JV8d2E4B23HTKuwTl6XJvsVNMtL6KrggrJVmbPkgmR64XodNOtnrfnHtL_dPUy6cmbTMgjdeMGhUMZLKCauj60uK2nLyJbQKVU_VTj5E1eew0G4q3tIAnFtgNlJ3SHD_YAhNoet4Wu7b-dXLKlpFlmvjav1sXp-iSjUxDLS2rjcmNfMqRdW3C1lXL58daKZx3xGkoPSSMXAK7tPJEreFOepPeon-u5JuPqy5fIc1XJ7VDX60arqa7Ejq3z34tbj2vABJ6Qx3M7e1jRZF7v-7Bye0J-jSjVF" Thank you, Thank you, Martin I have searched for solutions for a long time, and now you have saved me. All work fine Now. Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts