# Refresh Token: https://oauth2.googleapis.com/token POST https://graph.facebook.com/token Content-Type: application/x-www-form-urlencoded Reference: https://docs.deao.dev/cloudflare/social-media-posting/you-tube/refresh-token-https-oauth-2-googleapis-com-token ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /token: post: operationId: refresh-token-https-oauth-2-googleapis-com-token summary: 'Refresh Token: https://oauth2.googleapis.com/token' tags: - subpackage_socialMediaPosting.subpackage_socialMediaPosting/youTube responses: '200': description: OK content: application/json: schema: $ref: >- #/components/schemas/Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_Response_200 requestBody: content: application/json: schema: type: object properties: client_id: type: string description: '{env.YT_CLIENT_ID}' grant_type: type: string client_secret: type: string description: '{env.YT_CLIENT_SECRET}' refresh_token: type: string description: '{yt_refresh_token}' required: - client_id - grant_type - client_secret - refresh_token servers: - url: https://graph.facebook.com - url: https://www.youtube.com - url: https://youtube-video-summarizer-gpt-ai.p.rapidapi.com - url: https://api.cloudflare.com - url: https://dev-musiccast.odoo.com - url: https://api.search.brave.com - url: https://og-image-generator-dev.deao.workers.dev - url: https://musiccast.odoo.com - url: https://m.musicca.st - url: https://api.stripe.com - url: https://api.kie.ai - url: https://api.pexels.com - url: https://api.shotstack.io - url: https://oauth2.googleapis.com - url: https://www.googleapis.com - url: https://api.linkedin.com - url: https://www.linkedin.com - url: https://rupload.facebook.com - url: https://api.x.com - url: https://open.tiktokapis.com - url: https://open-upload-sg.tiktokapis.com - url: https://social-media-posting-dev.deao.workers.dev components: schemas: 'Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_Response_200': type: object properties: scope: type: string format: uri expires_in: type: integer token_type: type: string access_token: type: string refresh_token_expires_in: type: integer required: - scope - expires_in - token_type - access_token - refresh_token_expires_in title: >- Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_Response_200 ``` ## SDK Code Examples ```python Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example import requests url = "https://graph.facebook.com/token" payload = "" headers = {"Content-Type": "application/x-www-form-urlencoded"} response = requests.post(url, data=payload, headers=headers) print(response.json()) ``` ```javascript Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example const url = 'https://graph.facebook.com/token'; const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams('') }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://graph.facebook.com/token" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Content-Type", "application/x-www-form-urlencoded") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example require 'uri' require 'net/http' url = URI("https://graph.facebook.com/token") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/x-www-form-urlencoded' response = http.request(request) puts response.read_body ``` ```java Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://graph.facebook.com/token") .header("Content-Type", "application/x-www-form-urlencoded") .asString(); ``` ```php Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example request('POST', 'https://graph.facebook.com/token', [ 'form_params' => null, 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded', ], ]); echo $response->getBody(); ``` ```csharp Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example using RestSharp; var client = new RestClient("https://graph.facebook.com/token"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); IRestResponse response = client.Execute(request); ``` ```swift Social Media Posting_YouTube_Refresh Token: https://oauth2.googleapis.com/token_example import Foundation let headers = ["Content-Type": "application/x-www-form-urlencoded"] let request = NSMutableURLRequest(url: NSURL(string: "https://graph.facebook.com/token")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```