Hi
How the below Api can be executed using RestSharp .
googleapis.com/youtube/v3/videos?key=your-key&fields=items(snippet(title,description,tags))&part=snippet&id=youtube-id
Thanks
Hi
How the below Api can be executed using RestSharp .
googleapis.com/youtube/v3/videos?key=your-key&fields=items(snippet(title,description,tags))&part=snippet&id=youtube-id
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Feb 2, 2023, 8:21 AM
Hello Ramco,
PFB answer
var response = client.Execute(request); - [This line will execute the request and parse YouTube response into specific class].
Sample response, which will convert to YoutubeSearchListResponse Class.
Similarly for var tagResponse = clientTag.Execute(tagRequest)
Your response from API and your class structure Must be same to parse the API data to Specific class. If your response is different that it will create an issue.
Thanks
Naimish Makwana
Ramco RamcoPosted Feb 2, 2023, 8:05 AM
Hi Naimish
Can u explain me below 2 lines , how they work
Secondly on below line i am getting same error - if (tagResponse.IsSuccessStatusCode)
does not contain a definition for IsSuccessStatusCode
Thanks
Naimish MakwanaPosted Feb 2, 2023, 8:04 AM
Hello Ramco,
Can you please share your response data? It seems the response from the API is not valid due to that this exception is coming.
Thanks
Naimish
Ramco RamcoPosted Feb 2, 2023, 7:53 AM
Hi Naimish
I am getting same error on this line - var searchListResponse = JsonConvert.DeserializeObject(response.Content);
Thanks
Naimish MakwanaPosted Feb 2, 2023, 7:01 AM
Hello Ramco,
Use below code.
Please accept answer if its useful.
Thanks
Naimish
Ramco RamcoPosted Feb 2, 2023, 6:49 AM
Hi Naimish
I am getting this error on this line - var searchListResponse = JsonConvert.DeserializeObject(response.Content);
Thanks
Naimish MakwanaPosted Feb 2, 2023, 6:17 AM
In which method, You are getting error Run or GetTags?
Ramco RamcoPosted Feb 2, 2023, 6:11 AM
Hi Naimish
In below line i am getting error - does not conatin a definition for IsSuccessful
if (response.IsSuccessful)
Thanks
Naimish MakwanaPosted Feb 2, 2023, 5:52 AM
Hello Ramco,
PFB code for most viewed videos using Restsharp & then pass 1 by 1 ID of videos to get Tags
Please accept the answer if it's useful.
Thanks
Naimish Makwana
Naimish MakwanaPosted Feb 2, 2023, 4:17 AM
The
idparameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In avideoresource, theidproperty specifies the video's ID.Ramco RamcoPosted Feb 2, 2023, 4:10 AM
Hi Naimish
How i can get the list of most viewed videos using Restsharp & then pass 1 by 1 ID of videos to get Tags
Thanks
Jignesh KumarPosted Feb 2, 2023, 4:00 AM
Hello Ramco,
You can call google api using below call,
Naimish MakwanaPosted Feb 2, 2023, 3:54 AM
Hello Ramco,
Use below code.
Thanks
Naimish