Google YouTube API v3 403 error code

I created a new project and included the YouTube v3 data API. In the API access panel, I have a key for browser applications (with links), the witch works fine. I went ahead and created Key for iOS apps (with package identifiers). Everything looks good. I checked the package identifier 10 times, I am sure it is correct. However, if I continue and create NSURLRequest from my iOS application using the iOS API key, I get an error message:

error = { code = 403; errors = ( { domain = usageLimits; message = "Access Not Configured"; reason = accessNotConfigured; } ); message = "Access Not Configured"; }; } 

Using the same URL passing my key for browser applications (with links) works without any problems.

 NSString *string=[NSString stringWithFormat:@"https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=%@&fields=items(id,snippet(channelId,title,categoryId),statistics(viewCount))&part=snippet,statistics",key]; 

I am really puzzled by what is the problem here, I tried to get it to work with iOS apps Key hours now. Is there something obvious I'm missing?

+5
source share
2 answers

If you are making raw HTTP requests from any application (iOS or otherwise), you can include the "key for browser applications" as the URL key= parameter, and it should be enough (at least for read-only read, unauthenticated calls )

+7
source

This seems to work - add as your referrer HTTP, as the full www domain:

 chrome-extension://${chrome.runtime.id}/ 
0
source

Source: https://habr.com/ru/post/952822/


All Articles