How to get access to Google Analytics Real Time Reporting API - google-analytics

I filled the Real Time Reporting API Private Beta request access form many days ago but it seems that I can't access the API.
I sent a request to https://www.googleapis.com/analytics/v3/data/realtime but I get the following response:
{
"error": {
"code": 403,
"message": "Requests to this API analytics method analytics.gaapi.v3.AnalyticsDataRealtime.Get are blocked.",
"errors": [
{
"message": "Requests to this API analytics method analytics.gaapi.v3.AnalyticsDataRealtime.Get are blocked.",
"domain": "usageLimits",
"reason": "rateLimitExceeded"
}
],
"status": "PERMISSION_DENIED"
}
}
I know that my access token and credentials are correct because I can get sessions data successfully but I can't use the realtime API. What can I do to be whitelisted by google?

rateLimitExceeded indicates that the project queries per 100 seconds rate limits have been exceeded.
Recommended Action: Retry using exponential back-off. You need to slow down the rate at which you are sending the requests.
Documentation here: https://developers.google.com/analytics/devguides/reporting/core/v3/errors

Related

Google play developer API - Voided Purchases API response 403

I want to ask a question about IAB API - Voided Purchases API https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list
response:
{
"error": {
"code": 403,
"errors": [
{
"domain": "androidpublisher",
"message": "The current user has insufficient permissions to perform the requested operation.",
"reason": "forbidden"
}
],
"message": "The current user has insufficient permissions to perform the requested operation."
}
}
Please get me some suggestion about using this API. Thank you very much.
Maybe it's late but may help someone else
I think you pass the wrong query parameters to API.
a most common mistake is about timestamps for startTime and endTime
as the documents say :
The time, in milliseconds since the Epoch
check that your timestamp is in milliseconds and not seconds

FCM messaging responding with 503 consistently

I recently implemented FCM messaging as a means to perform push notifications to a Cordova based application. My system sends 100-1000 push notifications a day to individual users.
I'm contacting the FCM Messaging service using the FcmSharp library. https://github.com/bytefish/FcmSharp which as far as i can tell is using the FCM HTTP v1 API.
$"https://fcm.googleapis.com/v1/projects/{settings.Project}/messages:send"
So far it seem to be running ok. Yet i am continuously getting errors logged from the service that sends the messages to FCM indicating that there was a failure.
"error": {
"code": 503,
"message": "The service is currently unavailable.",
"errors": [
{
"message": "The service is currently unavailable.",
"domain": "global",
"reason": "backendError"
}
],
"status": "UNAVAILABLE"
}
The message i am sending (to FCMSharp) also appears to be formatted correctly:
message: {
"validate_only":false,
"message":{
"data":null,
"notification":{
"title":"[MyTitle]",
"body":"[MyBody]"
},
"android":{
"collapse_key":null,
"priority":"HIGH",
"ttl":"0s",
"restricted_package_name":null,
"data":null,
"notification":{
"title":null,
"body":null,
"icon":null,
"color":null,
"sound":"default",
"tag":null,
"click_action":null,
"body_loc_key":null,
"body_loc_args":null,
"title_loc_key":null,
"title_loc_args":null
}
},
"webpush":null,
"apns":{
"headers":null,
"payload":{
"aps":{
"alert":null,
"badge":0,
"sound":"default",
"content-available":0,
"mutable-content":0,
"category":null,
"thread-id":null
}
}
},
"token":"MyValidToken",
"topic":null,
"condition":null
}
As far as i can tell the service is not using the 'staging' environment mentioned in the post below.
FCM service unavailable nack
I am getting hundreds of these UNAVAILABLE answers a day, sometimes for hours on end. Messages are still getting through so i'm not sure i'm getting blacklisted. I don't see anything in their documentation to state if i'm using the wrong URL or hitting some sort of throttling limit.
This was because the FcmSharp service didn't implement the undocumented exponential back-off feature that is required by some Google Apis.
See the GitHub thread for more info.
https://github.com/bytefish/FcmSharp/issues/31

google translate api v2 response with code 403 and reason 'dailyLimitExceeded'

I have billing account 'Z' connected with project 'X' and google translate api enabled for this project.
Trying to perform GET request
https://www.googleapis.com/language/translate/v2?key={my_key}&q=hello&source=en&target=ru
got output:
{
"error": {
"code": 403,
"message": "Daily Limit Exceeded",
"errors": [
{
"message": "Daily Limit Exceeded",
"domain": "usageLimits",
"reason": "dailyLimitExceeded"
}
]
}
tried to generate another api key, all in vein, api key has no restrictions.
This is a known issue that should have been Fixed as of now, please try again to see if you're still seeing this issue and re-open the Issue #70990743 if necessary.

Rest API request for Google Translation API

I have a problem with Rest API request for Google Translation API
My POST method is https://translation.googleapis.com/language/translate/v2?key=MY_KEY
But I get an error
{
"error": {
"code": 400,
"message": "API Key not found. Please pass a valid API key.",
"errors": [
{
"message": "API Key not found. Please pass a valid API key.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
Please help me to understand where the problem comes from.
You might want to try starting with one of the samples as opposed to trying to build your own client library or get/POST with REST. If you must use REST, the following example may be helpful:
https://translation.googleapis.com/language/translate/v2?key=your-key-here&q=cheese&target=es
Replace the API key with the one that you have enabled access to the translate API on.

Meteor Google Calendar Push notification "Unauthorized WebHook callback channel"

I want to use google calendar notification.
I have deployed my Meteor application to
https://google-push-notification.meteor.com
I have verified the url in google web master.
Added the same domain to Domain Verification of Google Console.
I have created Meteor rest api of https://google-push-notification.meteor.com/api/articles for get and post method both.
Below is the postman collection of apis. https://www.getpostman.com/collections/106be7c94d35fcbdb0f8
Post https://www.googleapis.com/calendar/v3/calendars/abc#gmail.com/events/watch
Authorization: Bearer ya29.YwJdqjlSv8Tkl5MEJgiVXQPGxE24ZfITuf8gt0C8DO_VHDvB_1mRAgpAx64R6Wpw8I6fiw
Content-Type: application/json
{
"id": "ya29.XwI-RJ54rS3dbRHgak8V_iTuV7uAWJoZfRFnUE76uCIIUbw4eILPsdEME56Jm5_EfDtWWWs",
"type": "web_hook",
"address": "https://google-push-notification.meteor.com/api/items"
}
I am getting the following response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://google-push-notification.meteor.com/api/articles"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://google-push-notification.meteor.com/api/articles"
}
}
Why am I getting push.webhookUrlUnauthorized response even when I have verified my site in google and added the same domain in google console.
Can anyone please help us to solve the issue
According to the google forum, make sure you have validate the following items below:
Please make sure to follow the steps to correctly verify that the domain indeed belongs to you here: https://support.google.com/webmasters/answer/35179
It must be a https endpoint and the same endpoint must also be present in the developer console as per instructions here: https://developers.google.com/google-apps/calendar/v3/push#registering
Hope this resolve your issue. Cheers!

Resources