Google API calls from amazon instances - php

Am using the amazon instances to call the google shortener URL API. whenever i calls the server it returns the below error
(
[error] => stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[domain] => usageLimits
[reason] => rateLimitExceeded
[message] => Rate Limit Exceeded
)
)
[code] => 403
[message] => Rate Limit Exceeded
)
)
Please assist me to fix this issue.Thanks in Advance.

That error typically reflects a quota limit being exceeded, or a client sending too many unbatcheded requests at once. Unless you activate billing, your rate will be limited.

Related

Facebook message send API

I am trying to develop PHP Application through which I want to send message to any individual Facebook user.
I am using below API: https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message
I am following this one while developing my app: http://www.phpgang.com/facebook-messenger-api-for-pages-using-curl-php_3929.html.
But when I am running my application it throws error:
Array ( [error] => Array ( [message] => (#100)
No matching user found [type] => OAuthException [code] => 100
[error_subcode] => 2018001 [fbtrace_id] => Ha3u2Mvk1ZF ) )
Please somebody help, I am stuck in this.

Is it possible to call rest API using PHP, inside GAE for putting data at pull queue?

Is it possible to call rest API using PHP, inside GAE for putting data at pull queue ??
I am trying to call rest api to put data at pull queue but I get an error
Array
(
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => forbidden
[message] => you are not allowed to make this api call
)
)
[code] => 403
[message] => you are not allowed to make this api call
)
)
You might want to try my PHP Pull Queue library for App Engine.
https://github.com/tomwalder/php-appengine-pull-queue
It's in very early ALPHA, but might work for you.
Removes the need for the REST API entirely. Uses native Google Protocol Buffers (same as the Python/Java/etc. runtimes)
Tom

Google APIs Client Library for PHP - countryBlocked exception

I've created a web application which runs with the 'Google APIs Client Library'.
This worked perfectly for me for the last two years.
But since yesterday I am facing a huge problem.
If I want to access the analytics api the system returns:
Google_Service_Exception Object
(
[errors:protected] => Array
(
[0] => Array
(
[domain] => global
[reason] => countryBlocked
[message] => This service is not available from your region
)
)
[retryMap:Google_Service_Exception:private] => Array
(
[500] => -1
[503] => -1
[rateLimitExceeded] => -1
[userRateLimitExceeded] => -1
)
[message:protected] => Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) This service is not available from your region
)
I've checked the logs and made 50 requests the last 30 days so spamming could not be the reason for the block.
When I run it from a different Server it runs just fine.
Can anyone explain why this is happening and how I can bypass it?

Fetch Report using GoodData API

I have created a report on my GoodData UI. Now I want to fetch this report using the API. I spent hours digging the API docs but I am unable to find a simple way to do so.
If I try gdc/execute/raw/, it returns
[error] => Array
(
[parameters] => Array
(
[0] => execute
)
[requestId] => 53fPgKcFdkjf8PZ5:4n6x9lp9vk3ydbvs
[component] => GDC
[errorClass] => GDC::Exception::NotFound
[message] => resource %s not found
)
If I try gdc/xtab2/executor3 it returns
[error] => Array
(
[parameters] => Array
(
[0] => report_req
[1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject: Object does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq' ...]
)
[requestId] => a0yRpNUpCPRsbPS0:6nagmwaw61h5g2bn
[component] => Apache::REST
[errorClass] => GDC::Exception::User
[message] => Checking '%s', result %s
)
Your requests got 404 and 400 statuses respectively.
When you tried to use 'gdc/execute/raw/' the call that reached our side was: "request="POST /gdc/execute/raw/ HTTP/1.1"", instead of that it should look like "POST /gdc/app/projects/{your_project_id}/execute/raw/ HTTP/1.1", that's the reason your are getting a 'NotFound' error. Regarding 'gdc/xtab2/executor3' there's apparently something wrong within the body of the call.
Please post your calls here, their bodies and how exactly you are making them, or open a support ticket with those details at https://support.gooddata.com/home so that we can investigate further.
Ultimately I followed this code piece https://gist.github.com/gnilrets/b9d2ce9890d8aaa07042
Much better than reading the whole GoodData API documentation.

Google REST call fails inside codeigniter

I've got a REST call to my Google calendar that works out fine on my old website (www.gmbc.org/events.php), but when the identical call is made from a codeigniter controller, the timeMin / timeMax options cause it to throw a 400 at me (remove them, and the call successfully retrieves the whole calendar from 2012):
$st_date = date(DateTime::ATOM);
$end_date = date(DateTime::ATOM, time()+(31 * 24 * 60 * 60));
$call_url = 'https://www.googleapis.com/calendar/v3/calendars/calendar%40gmbc.org/events?timeMin='.$st_date.'&timeMax='.$end_date.'&singleEvents=true&orderBy=startTime&key=[mykeythatworksjustfine]';
$events_call = $this->curl_get($call_url);
echoing $call_url confirms it's being created identically, and print_r-ing the result confirms it's reaching google:
stdClass Object (
[error] => stdClass Object (
[errors] => Array (
[0] => stdClass Object (
[domain] => global [reason] => badRequest [message] => Bad Request )
)
[code] => 400 [message] => Bad Request
)
)
...what could possibly be going on? Does codeigniter interfere with the curl call?
I am able to successfully retrieve events from this calendar with TimeMin and TimeMax set using the API explorer: https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.list?calendarId=calendar%2540gmbc.org&timeMax=2014-11-30T00%253A00%253A00Z&timeMin=2014-10-01T00%253A00%253A00Z&_h=2&
The query it's sending is:
GET https://www.googleapis.com/calendar/v3/calendars/calendar%40gmbc.org/events?timeMax=2014-11-30T00%3A00%3A00Z&timeMin=2014-10-01T00%3A00%3A00Z&key={YOUR_API_KEY}
Try making sure the query you are sending from PHP ends up the same.

Categories