It cause Domain=com.google.GTLJSONRPCErrorDomain Code=403 "The
operation couldn’t be completed. (Daily Limit Exceeded. Please sign
up)"
However, the code below works. Why?
NSURL *url = [NSURL URLWithString:@"https://www.googleapis.com/
calendar/v3/colors?key=MYKEY"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
GTMHTTPFetcherService *fetcherService = [service fetcherService];
GTMHTTPFetcher *fetcher = [fetcherService
fetcherWithRequest:request];
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError
*error) {
if (error == nil) {
NSString *str = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSLog(@"%@", str);
[str release];
}
}];
Thank you for your advice. My service has auth object but fails.
I can get calendars.list and events.list with same service but colors.
Do I have to add some header properties else?
Dice-K
calendar.colors.get
2011-11-28 07:19:46 +0000
Request: POST https://www.googleapis.com/rpc?prettyPrint=false
Request headers:
Accept: application/json-rpc
Authorization: Bearer _snip_
Cache-Control: no-cache
Content-Type: application/json-rpc; charset=utf-8
User-Agent: jp.co.cybernet.CSC.GTLCalendar/1.0 google-api-objc-
client/2.0 iPhone_Simulator/5.0 (gzip)
Request body: (100 bytes)
{
"method" : "calendar.colors.get",
"id" : "gtl_3",
"jsonrpc" : "2.0",
"apiVersion" : "v3"
}
Response: status 200
Response headers:
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Date: Mon, 28 Nov 2011 07:19:46 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
Transfer-Encoding: Identity
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Response body: (256 bytes)
{
"id" : "gtl_3",
"error" : {
"message" : "Daily Limit Exceeded. Please sign up",
"code" : 403,
"data" : [
{
"domain" : "usageLimits",
"reason" : "dailyLimitExceededUnreg",
"extendedHelp" : "https:\/\/code.google.com\/apis\/console",
"message" : "Daily Limit Exceeded. Please sign up"
}
]
}
}
> http://code.google.com/p/google-api-objectivec-client/wiki/Introducti...