I am developing an iOS app that uses the Evernote API. Everything has been working fine, but then I started getting "code 403" to my requests.
Authentication to the service goes well: I am able log on and download all info I need (Notebooks, Notes, Note content, etc...). But when I try to get the thumbnails, I get 403.
My code for the request:
NSString *thumbnailPath = [NSString stringWithFormat:@"%@thm/note/%@?75", [[EvernoteSession sharedSession] webApiUrlPrefix], note.guid];
NSLog(@"THUMBNAILPATH %@", thumbnailPath);
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:[[EvernoteSession sharedSession] webApiUrlPrefix]]];
[httpClient clearAuthorizationHeader];
[httpClient setAuthorizationHeaderWithToken:[[EvernoteSession sharedSession] authenticationToken]];
[httpClient postPath:thumbnailPath parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
note.thumbnail = responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"REQUEST: %@", thumbnailPath);
NSLog(@"Error: %@", error.localizedDescription);
}];
If I copy what the "REQUEST:" log result, it is a well-formatted link that gives me the thumbnail in my browser. But the second log gives me: "Error: Expected status code in (200-299), got 403".
I am out of ideas. Can anyone help?