Youtube api v3 error "SSL is required to perform this operation"
Asked Answered
G

2

6

Looking for some insight into how to get video information using youtube's v3 api.

When passing the url, the json response I get is:

{"error":{"errors":[{"domain":"global","reason":"sslRequired","message":"SSL is required to perform this operation."}],"code":403,"message":"SSL is required to perform this operation."}}

All I'm trying to do is get basic information (title, description, etc) so I used "snippet" for the part.

Here's a sample url i'm using:

http://www.googleapis.com/youtube/v3/videos?id=Ho4XgLj40Ss&part=snippet

I have tried creating an API Key and adding &key={my_api_key} to the end of that url.

If the environment matters, I'm using a jquery getJSON request in a custom Wordpress theme.

I should mention that in the "try it now" section in the documentation, it returns a nice json object - with the OAuth off.

Grand answered 30/5, 2014 at 17:12 Comment(3)
What part of the error don't you understand?Joviality
I guess I'm not sure why I'm getting the error at all. Why does getting public information for a public video require ssl? How do I go about making the proper request.Grand
I could have swore I tried that... headdesk Thanks!Grand
T
16

I had the same problem for another API. As SLaks pointed out in the comments, just use https:// instead of http://

In your case, try :

https://www.googleapis.com/youtube/v3/videos?id=Ho4XgLj40Ss&part=snippet
Tinhorn answered 4/9, 2014 at 21:52 Comment(0)
H
1

Adding to @Xavier's answer, if you are using this API in a Flutter environment, then you can change your

Uri.http(baseUrl, endPointUrl, parameters);

to

Uri.https(baseUrl, endPointUrl, parameters);

Notice the https above.

Herdsman answered 1/6, 2020 at 6:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.