Error when trying to validate In-app purchase at Google Play - php

I try to make a validation of purchases on the server, but it can't to make a request to Google Play Android Developer API. After a request it shows this one:
Error calling GET https://www.googleapis.com/androidpublisher/v1.1/applications/my.app.id/inapp/my_in_app_purchase/purchases/purchase_token: (403) Forbidden
If I make a validation of this purchase by the test form in Developers Console, everything is OK and Google API would send a response.
Requests to other API (for example Books API) works fine.
To work with API I use Google APIs Client Library for PHP. Authorization goes by Service Account. In Developers Console access to Google Play Android Developer API is on.

Ok I found the solution!
You must to connect your API with your app. You must go to your Google Play publish page (https://play.google.com/apps/publish) and invite a user with the service account email in Settings->User account & rights->Invite new user and give it the privileges of "View financial reports".
Thanks works for me, good luck!

Related

Use Service Account to connect search console via Google-php-API

Have been struggling to connect to Google API
via PHP using Service Account. If to use examples provided by API (link) and google developers site itself (or any other source from google searches), I'm getting the error
{
"error": "invalid_grant",
"error_description": "Invalid JWT Signature."
}
And if to search how to connect using JWT as well, there are only JS or JAVA or PYTHON examples.
Any real experience out there how to correctly get the connection?
I have:
service account set up and allowed to use Search Console (and analytics)
set up the API to server
added service account address to Search Console for site we need the data from
downloaded and added the key file.
All goes well till I start making the actual request for data. Then the JWT error appears.
ANY input is appreciated!
Got solution by removing service account from google console and created new.

How to integrate Hubspot App with live CRM?

I don't know if I'm missing something, but I've carefully followed Hubspot's API documentation and have successfully integrated my codebase with a "Test Hub", using cURL and PHP, but I cannot figure out how to now point this to the live hub? Where do I get the Client ID and Client Secret from my live Hubspot account? Or at least connect my live site to the app I have created?
Ok so apparently you have to have a matching developer account email address as the one that is in the Hubspot account. That is, if you are a developer, you have to also have an account inside of the Hubspot instance you are connecting to.
Thanks BAD UI and documentation.

Google Analytics Number of Requests Exceeded Exception

I am developing a website where I am integrating Google Analytics in the project. All is working fine but sometimes I get the error that "Number of Requests Limit exceeded. Please signup to Google Developers console" something like that. I have searched the internet and they have described that obtain the "Client ID" from Google Developers Console.
I have done that but now I cannot find that where to put that "Client ID" in the API file? I am using the "gapi" class for fetching the Google Analytics data. But in the "gapi.class.php" file there is no option for the "Client ID" which I have obtained from Google Developers Console.
Where to put the "client ID" OR there is something I am doing wrong?
It seems that you are using this library which is a third party library that authenticate the user through email/password in order to access his analytics account.
If you need to access the GA API as documented here maybe you will have to use another library. Google is providing a PHP library to access the API. Also, if you look at the code samples you will see that they are using the API KEY and the Client ID to authenticate (the Client ID is not always needed depending on what you are requesting).

Getting data from a analytics account using Google Analytics API and PHP

I'm developing a backoffice for a website in PHP.
In that backoffice I would like to output some google analytics info refering to that site. And only that site.
For that, I looked into the google analytics API, but I'm having some problems that I don't know if can overcome.
I don't want the API to ask for the user to login or authorization.
I want the API to access always the same account (mine) and not another google analytics account, so no authorization required.
Can that be done?
Can someone point me to a good tutorial about using the API in the context I'm looking for?
Thank You.
You can't do this with the regular API; as you mentioned, it requires the user to login. However, you can do this with the Google Analytics superProxy API.
Yes - it's possible.
You CAN connect directly to the API without it asking for authorization.
See:
Service Applications and Google Analytics API V3: Server-to-server OAuth2 authentication?

Mobile apps server side programming (Accessing google calendar usingPHP)

I am trying to access google calendar from php program. I am using a php program as middle person to communicate with my android program and Goolge Calendar.
Google provided API to access calendar. when I try to access calendar it asks for authentication, then Login to google account, then Grant Access permision. My problem is I don't need multiple steps to access calendar. I will send Gmail ID and Password from android program to php by calling Calendar.php(For ex:), then php should receive that and directly login to Google Calcendar.
You cannot do this. Google uses OAuth for all it's 3rd party plugins, so the user has to go to a google page to authenticate, and then your app is given an OAuth key to use.
This is to stop you from maliciously storing the username and password given to your app and mis-using it.
Have you try the Canlendar.php demo from ZEND_GDATA which provided by google?
specially function 'outputCalendar'.that's the function to retrieve events from google calendar.
You can preview codes here
you should download demos somewhere and check yourself :)

Categories