Jump to content

Recommended Posts

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 post
Share on other sites
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 post
Share on other sites
  • ESET Staff

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

Link to post
Share on other sites
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...