Sixer
Sixer

Reputation: 11

YouTube Data Api v3 in C#

I am learning to use YouTube Data Api v3 in C#. What I want to do is to manage YouTube Playlists (Create, Delete, Update). I want it to be a console project. I used the sample playlist code given here. I've used the Create Playlist Code but when I run it it shows me the following Error:

The redirect URI in the request, 127.0.0.1:52222/authorize/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: <...>

The project is in initial faces. Can anyone guide me? I don't know what is the problem.

Upvotes: 0

Views: 654

Answers (1)

Jessica Rodriguez
Jessica Rodriguez

Reputation: 2974

Before you copy the code from the Youtube API documentation, it is important to understand the basics of how API authentication and authorization are handled. All API calls must use either simple or authorized access (defined below). Many API methods require authorized access, but some can use either. Some API methods that can use either behave differently, depending on whether you use simple or authorized access.

From your Google API Console, you must set your Authorized Javascript Origins and Authorized redirect URIs. When Google's server gets authorization from the user, then it will redirect the browser to whatever you sent in as the redirect_uri. The redirect URIs are in the client_secrets.json file that can verify the flow of OAuth and will specify the match that your app allows.

For more info, you can visit the Get Start documentation using .Net.

Upvotes: 1

Related Questions