• Hello,

    I have activated the Youtube API and generated a key.
    Once in the setting screen, I fill in the key but I have this message :

    API key not OK, your key seems to be valid, but is not activated for IP address of your server.Try to change allowed IP address with this one: 10.7.40.74

    First, would you have an idea why it is not working ? (I have tried to restrict key with IP and domain, none is working.)
    Second, what is this IP suggested to use : 10.7.40.74 ?

    Thank you!

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    The YT/Google API key validation is a black box for me as well I’m afraid, maybe try generating a new key without restrictions?

    Re. the IP address; that’s the internal IP address your server is running under, it’s irrelevant in this context I’m afraid.

    frank

    Thread Starter rom174

    (@rom174)

    Ok glad to hear it, thank you.
    In order to not generate errors in the google structured data testing tool, do you have an idea about how to retrieve videos datas for micro data without the YT API ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    no, without a working API key you can’t retrieve the video data I’m afraid :-/

    Thread Starter rom174

    (@rom174)

    Okay
    Do you think there something to do being connected to the Youtube account managing the channel ? Or with the channel id ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    to retrieve video data (as opposed to changing/ adding data) you don’t need any special rights, it works with any valid key. the key not validating in the LYTE settings screen is very likely due to the (ip/ referred) restrictions you added I’m afraid.

    Thread Starter rom174

    (@rom174)

    Ok so in this case, I don’t understand what is missing.
    Thank you @optimizingmatters

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, have you been able to succesfully add an API key in the LYTE settings screen?

    Thread Starter rom174

    (@rom174)

    No, not at all… that’s why I don’t understand what is missing. I said thank you for trying to help.

    I will continue to investigate and let you know if I find anything.

    • This reply was modified 5 years, 2 months ago by rom174.
    Thread Starter rom174

    (@rom174)

    Hello @optimizingmatters

    I have finally resolved to make the key working, at least in the settings screen :

    API seems OK, you can Save Changes below now.

    The issue was that I need to create credentials and fill in what seems grpd related.

    I saved it, made the cache empty, but now there is no data retrieved from the YT api while I can see the number of queries growing in the google apis dashboard (quotas tab).

    The meta fields dscription, name and uploadDate remain empty.

    Would you have a hint about it ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    and do you see any errors in the PHP errorlog that might shed a light on this?

    Thread Starter rom174

    (@rom174)

    I checked it but there is nothing in it, I also checked the debug.log file (which displays sometimes more things), there is nothing more.

    Finally, I found the link api on a site and in the plugin code to get the data : https://www.googleapis.com/youtube/v3/videos?part=id%2C+snippet%2C+contentDetails&id={video_ID}&key={YT_api_key}
    but I can’t see it in the network tab of the inspector dev tool ?
    Is it a normal thing not to see it as a request ?
    I add that the key is working because if I replace api key and video ID in the url above and put it directly in the address bar, I get the JSON with all the video datas.

    Can it help you in any way ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    but I can’t see it in the network tab of the inspector dev tool ?
    Is it a normal thing not to see it as a request ?

    Yes that’s normal; the YT API requests are made at server level, not at browser level.

    Can you follow the steps described here and check if you see the cached data?

    Thread Starter rom174

    (@rom174)

    I did the step from your blog, and it works. Thank you !
    Is there a way to “clean” every post in one time instead of manually editing each one ?

    A last question :

    Yes that’s normal; the YT API requests are made at server level, not at browser level.

    After it worked, I checked the server log but nothing related to /v3/, www.googleapis.com/, nor /youtube/ in it. Should I find a reference to the youtube api in the server log file ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Is there a way to “clean” every post in one time instead of manually editing each one ?

    you can try the “clear cache” option on the LYTE settings-screen.

    After it worked, I checked the server log but nothing related to /v3/, https://www.googleapis.com/, nor /youtube/ in it. Should I find a reference to the youtube api in the server log file ?

    no; webserver logs have incoming requests, outgoing requests are not logged ??

    Thread Starter rom174

    (@rom174)

    no; webserver logs have incoming requests, outgoing requests are not logged

    Sorry for that question…

    you can try the “clear cache” option on the LYTE settings-screen.

    Well, this is what I did but only custom fields that have already been manually removed one time (so the ones treated after the process explained in your link) are flushed when clearing cache from the setting screen.

    Do you think it can be linked with the lyte_unprotect_meta() function ?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘API key not working’ is closed to new replies.