List
401 Unauthorized Error while using Web API calls
Posted Date: 2020-01-28 8:31     Edited Date: 2020-08-28 7:11     Writer: inactive

Please provide your development details as below;

1. SDK Version: 5.0
2. Development Environment: Unity-Android
3. Tracker/Scanner: Tracker
4. License Type(Free / Pro-One Time Fee / Pro-Subscription / Enterprise): Free
5. Target Device(Optional):
 

Even after pasting the JWT authorization token, and the other requirements, I get the 401 error while using the Web API call.

Reference :  https://developer.maxst.com/MD/doc/5_0_x/cloud/webapi

Posted Date: 2020-01-30 1:11     Edited Date: 2020-02-03 8:44     Writer: inactive

Your token does not seem to be valid. Cloud licenses are automatically deleted after a month.

Please let me know when you got a cloud license.

 

Leo

Maxst Support Team

Posted Date: 2020-01-30 5:23     Edited Date: 2020-01-30 5:23     Writer: inactive

Do u mean that I will be able to make Web API calls only after getting the cloud license? 

And also the above mentioned images depicts the response of the API call, and not the token itself. I haven't specified the token I used.

To generate the token, I used jwt token generator as specified in the maxst developer page. I got the token as follows

  1. I created a Target group
  2. I used the (access keys) Secret Key and ID of that target group.
  3. The JWT token had the Sec ID and iat (current timestamp)
  4. And the 256 bit secret Key
  5. This is the JWT header
    • {
        "alg": "HS256",
        "typ": "JWT"
      }

What might be the problem?

Do u mean that I will be able to make Web API calls only after getting the cloud license? 

Posted Date: 2020-01-30 6:42     Edited Date: 2020-01-30 6:42     Writer: inactive

Even if you don't use a cloud license, you can still use the Web API in a general license target group. First of all, the purpose of using the Web API is to learn and upload images to a target group. If the image to be uploaded to the target group is about 3,000 or 5,000 sheets, it is difficult to upload by pressing the Upload Image button. This is to upload a large amount of images through the API.

And it seems to confuse how to use the Web API. See the page below and follow along.

https://developer.maxst.com/MD/doc/g/localwebapi 

Thank you.

 

Leo

Maxst Support Team

Posted Date: 2020-01-30 7:40     Edited Date: 2020-01-30 7:40     Writer: inactive

Actually, I already referred to the developer page that you have specified above. And I understand the purpose of making an API call. So, let me explain my problem in detail. 

I'm using Maxst SDK 5.0, and hence using the instructions specified in this page.

First of all, I'm trying to use the 'Get Target Group' call.  I tried this using PostMan App  to make the call.

So I did the following:

  1. Created a target group and found the Access Keys
  2. Created a JWT token using this JWT Token Generator. Used the Secret Key, Secret ID and current iat, following the instructios specified in Maxst page.
  3. Opened PostMan application, and pasted the authorization token. 
  4. Specified the Content-Type of the request as 'application/json; charset=utf-8'.  
  5. This request is of type GET, and requires no parameters. Hence sent the request as follows. 
  6.  And the reply was as follows. Authorization denied!!!!!

Now, I just wanna know, why is it denied, and how to solve this issue. 

 

 

Posted Date: 2020-02-04 1:06     Edited Date: 2020-02-04 1:06     Writer: inactive

The page you are viewing is the Cloud WebAPI.

https://developer.maxst.com/MD/doc/5_0_x/cloud/webapi

The page we told you to view is the Local Web API.

https://developer.maxst.com/MD/doc/g/localwebapi

The two pages have a different PAYLOAD that is used for token generation. Please note.

Thank you.

 

Leo

Maxst Support Team

Posted Date: 2020-02-04 11:00     Edited Date: 2020-02-04 11:00     Writer: inactive

Got it :D Thanks a lot :)

Posted Date: 2020-02-05 9:05     Edited Date: 2020-02-05 9:05     Writer: inactive

Good Luck To you.

 

Leo

Maxst Support Team

Posted Date: 2020-08-28 7:11     Edited Date: 2020-08-28 7:11     Writer: inactive

Do we need a paid lisence for using the cloud web api? I'm getting the same error "Authorization has been denied for this request.", I followed the cloud web api page, https://developer.maxst.com/MD/doc/5_0_x/cloud/webapi

also what is the difference between cloud web api and local web api?

Here is what I want to do, "I want to upload some images via the cloud api and store the response in my server", what steps should I take for that?