This guide walks through connecting your YouTube account to POSSE Party so it can upload videos on your behalf.
Client IDfor your Google Cloud OAuth clientClient Secretfor that clientAccess Tokengenerated for theyoutube.uploadscopeRefresh Tokenpaired with that access token so POSSE Party can renew it
All four values come from your Google Cloud project’s OAuth client and the token exchange step below.
- Create a Google Cloud project and enable the YouTube Data API
- Configure OAuth consent and scopes
- Create an OAuth client with POSSE Party redirect URLs
- Add test users to the OAuth consent screen
- Authorize POSSE Party and exchange the code for tokens
- Add YouTube to POSSE Party
- Visit https://console.cloud.google.com and sign in with the Google account you use for YouTube. Check I agree… and click Agree and continue
- In the top bar, click Select a project.
- In the Select a project dialog, click New Project.
- Give the project a clear name (for example,
POSSE Party YouTube) and click Create.
- Wait for creation to finish, then click Select project for the new project so it becomes the active one.
- In the left sidebar, choose APIs & Services → Library.
- Search for YouTube Data API v3.
- Click the YouTube Data API v3 result to open its details page.
- Click Enable to enable the API for your project.
- After enabling, click Create credentials to start the OAuth setup.
- When prompted for Credential type, select User data and click Next.
- On the OAuth consent screen step, fill out an app name and enter a user support email.
- Provide a developer contact email and click Save and continue.
- On the Scopes step, search for the scope ending in
/auth/youtube.upload.
- Check the box next to the YouTube upload scope and click Update.
- Back on the scopes list, click Save and continue to proceed.
- On the OAuth client ID step, choose Web application as the application type and give it a descriptive name.
- Under Authorized redirect URIs, add two URLs and then click Create:
- Your POSSE Party instance URL with the YouTube credential renewal path (e.g.,
https://example.posseparty.com/credential_renewals/youtube) - A localhost URL you will use once to obtain the initial tokens. (e.g.,
http://localhost:1234/callback)
- Your POSSE Party instance URL with the YouTube credential renewal path (e.g.,
- Under "Download your credentials", click Download.
- Open it in a text editor; it will contain a JSON object that looks like:
{
"web": {
"client_id": "myclient.apps.googleusercontent.com",
"project_id": "posse-party-example-lol",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "myclientsecret",
"redirect_uris": ["https://example.posseparty.com/credential_renewals/youtube"]
}
}Take note of the client_id and client_secret values.
- Click Done to exit the wizard.
- In the left sidebar, click OAuth consent screen and then click Audience.
- Scroll down to Test users and click Add users.
- Add the email addresses for any Google accounts you plan to authorize with POSSE Party and click Save.
Next, you will perform a one-time OAuth flow using the localhost redirect URI to obtain an initial access token and refresh token.
- Copy the URL below and replace these two values:
CLIENT_IDwith the client ID you noted earlierCALLBACK_URLwith the local callback URL you entered (we had suggestedhttp://localhost:1234/callback)
https://accounts.google.com/o/oauth2/v2/auth?client_id=CLIENT_ID&redirect_uri=CALLBACK_URL&response_type=code&scope=https://www.googleapis.com/auth/youtube.upload&access_type=offline&prompt=consent
- Open the URL in your browser and choose the Google account whose YouTube channel you want to connect.
- Click the less prominent Continue link to proceed.
- Click Continue again.
- Your browser should redirect to your localhost URL. Don't be alarmed that it fails to connect! The value we need is in the URL itself.
- Copy the URL from your browser's address bar and extract the
codequery parameter and take note of it
- Open a terminal and run these commands, replacing the strings with the values you've noted in previous steps:
export CLIENT_ID="myclient.apps.googleusercontent.com"
export CALLBACK_URL="http://localhost:1234/callback"
export AUTH_CODE="the-code-you-just-copied"
export CLIENT_SECRET="myclientsecret"- In the same terminal window, run the following
curlcommand to exchange the OAuth code for access and refresh tokens
curl --request POST \
--data "code=$AUTH_CODE" \
--data "client_id=$CLIENT_ID" \
--data "client_secret=$CLIENT_SECRET" \
--data "redirect_uri=$CALLBACK_URL" \
--data "grant_type=authorization_code" \
https://oauth2.googleapis.com/token- Google should return JSON similar to:
{
"access_token": "yourtokenhere",
"expires_in": 3599,
"refresh_token": "yourrefreshtoken",
"scope": "https://www.googleapis.com/auth/youtube.upload",
"token_type": "Bearer",
"refresh_token_expires_in": 604799
}Copy both the access_token and refresh_token values for use in POSSE Party.
-
In POSSE Party, go to Accounts and click Add Account. Give the account a label and select YouTube as the platform.
-
Under Credentials for YouTube, fill:
Client IDClient SecretAccess TokenRefresh Token
Once saved, POSSE Party will be able to create YouTube posts for crossposts that include exactly one video, and will use your refresh token to renew the access token as needed.




























