Need help!!! Google API return empty results

Options

Hi, I tried to get the list of favorite Youtube videos using the following API. I set up on Xano and got success response but the problem is that Xano returns empty result.

https://developers.google.com/youtube/v3/docs/videos/list


First, the custom function "google_service account_access_token" returns the access token and then I am calling the Youtube data API request by using that access token.

I get 200 successful response but I get empty results in items (see red circle screenshot below)

Items are supposed to be a list of favorite videos as stated in the API document.

I tried the same Youtube API in another place with same parameters and Authorization set up and they were all working fine so I must be missing out something in Xano.

Could anyone help me?

This is how I set up Youtube API request.

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @ken — it just looks like the API doesn't have any results based on the parameters that you are using. I'm wondering if because you are looking to get your own list of favorite YouTube videos if OAuth is a better authentication method than Google Service Account for your use case

  • ken
    ken Member
    Options

    thanks @Michael Udinski so How can I integrate OAuth into Youtube data API call?

    What should I set as redirect_url/ code etc in order for Oauth to work in run& debug mode?

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    You redirect URI comes from your front-end. OAuth will require your user to actually "Accept" permissions for Google to access certain things from your YouTube profile. Whereas a Google Service Account is a way to authenticate programmatically. To learn OAuth, I'd watch this video. Even though it's with Bubble it covers the concepts of OAuth in general that are applied to any front-end: