I get UNAUTHENTICATED error when I call Method: purchases.subscriptions.get endpoint

loki

When I try to call https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token} from my backend server to verify a purchase I receive :

{
  "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "errors": [
      {
        "message": "Login Required.",
        "domain": "global",
        "reason": "required",
        "location": "Authorization",
        "locationType": "header"
      }
    ],
    "status": "UNAUTHENTICATED"
  }
}

How can I authenticate from my backend server (so without any user interface)? Is there any way to create an API key somewhere and use it to authenticate?

DaImTo

The error message

Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

States that authorization is required.

If you check the documentation for Method: purchases.subscriptions.get

You will notices that it states that this method requires authorization with the following scope

enter image description here

Assuming this is an account you the developer control and you only want to access this single account you should look into using a service account for authorization. Documentation here Using a service account

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

I get 404 error when I try endpoint on localhost

get response when i call the post method

RewriteRule get error when i call xajax

Why is __get called instead of __call when I call a nonexistent method?

I get this error when I install acpi-call-dkms

When I fetch using GET method I receive an error 502

Unauthenticated call to Endpoint working for an API method with authentication

Why I get that error Call to undefined method Facebook\Facebook::api()?

Firestore returns me null value when I call the get method?

When reload happens i get Invalid hook call react error

Why do I get compilation error when doing flatmap() call?

In App Purchases where I can get the token?

Why do i get an an error on paint method when the parameters are correct?

Why I get error message when transfer INSERT method to Function

Why do I get a compile error when calling start method?

Flutter: Why do I get an error when using the setState() method?

Attempt to call a method but I get a NullPointerException

How can I get number of added subscriptions?

Why do I get parent elements when I call the SimpleXMLElement::xpath method on a child element?

when I vagrant up, I get error

I get this error when I try to install

I get this error when I add it to the Video Texture View xml file(java.lang.BootstrapMethodError: Exception from call site #72 bootstrap method)

Why do I get 'Error: Invalid hook call' when I am calling inside a function?

I get this error when I insert a new post in the db "Call to a member function load() on null"

why i get "no attirubute error" when i try to call python function from c++

Call must be made on main thread i can get the data but when i want it to show error message it crashes

Why do I get error INVALID_OPERATION when I call glMultiDrawElementsIndirect

Why do I get an error message of NoneType object is not callable when I try to call this function?

Can anyone tell me why I get a error when i try to call this function?