Hi
Can we add a like to youtube video programmatically.
Thanks
Hi
Can we add a like to youtube video programmatically.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 16, 2023, 2:20 AM EST
Hi Naimish
Can u pls provide any sample code
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 16, 2023, 3:17 AM EST
Hi Naimish
How i can get Access Token
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 16, 2023, 3:59 AM EST
Hi Naimish
Will it be possible to provide any sample code. I have Api Key , Client Id, Client Secret
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 16, 2023, 4:15 AM EST
Hi Nimish
I am getting this error - {
"error": "unsupported_grant_type",
"error_description": "Invalid grant_type: client_credentials"
}
What is to be given in - request.AddParameter("grant_type", "client_credentials");
Thanks
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 15, 2023, 11:55 PM EST
Hello Ramco,
You can use below API
https://www.googleapis.com/youtube/v3/videos/rate
Thanks
Naimish Makwana
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 16, 2023, 2:24 AM EST
Hello Ramco,
Sample Code:
using RestSharp; var client = new RestClient("https://youtube.googleapis.com/youtube/v3/videos"); var request = new RestRequest("rate", Method.POST); request.AddParameter("id", ""); request.AddParameter("rating", "like"); request.AddParameter("key", "[YOUR_API_KEY]"); // set the authorization token in the request headers request.AddHeader("Authorization", "Bearer [YOUR_ACCESS_TOKEN]"); request.AddHeader("Accept", "application/json"); var response = client.Execute(request);Thanks
Naimish Makwana
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 16, 2023, 3:24 AM EST
Hello Ramco,
For Access Token, you need to refer below link:
https://developers.google.com/identity/protocols/oauth2
Thanks
Naimish Makwana
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 16, 2023, 4:07 AM EST
Hello Ramco,
Try below code.
using RestSharp; using Newtonsoft.Json; var client = new RestClient("https://oauth2.googleapis.com/token"); var request = new RestRequest(Method.POST); request.AddParameter("client_id", "YOUR_CLIENT_ID"); request.AddParameter("client_secret", "YOUR_CLIENT_SECRET"); request.AddParameter("grant_type", "client_credentials"); var response = client.Execute(request);Thanks
Naimish Makwana
Naimish MakwanaRank #324 · 7.7K reputationPosted Feb 16, 2023, 4:26 AM EST
Hello Ramco,
Refer below link. Its provide the functionality to get accesstoken in postman.
https://hmh.engineering/how-to-get-oauth-access-token-and-retrieve-data-from-google-apis-using-postman-9a95ffe030ae
Thanks
Naimish
Ramco RamcoRank #462 · 5.4K reputationPosted Feb 16, 2023, 5:08 AM EST
Hi Naimish
I am getting this error - Error: Invalid protocol for auth URL. Only HTTP and HTTPS protocol are allowed.
Url is - https://oauth2.googleapis.com/token
Thanks