Social Accounts
Connect
Initiate an OAuth flow to connect a social media account.
Endpoint
Path Parameters
| Parameter | Type | Description |
|---|---|---|
platform | string | Platform to connect: "twitter", "youtube", "pinterest", or "linkedin" |
| *More coming soon |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
redirectUri | string | No | URL to redirect the user to after successful connection |
Example
With redirect:
Response
Redirect the user to the returned url. After they authorize on the platform, PostPeer's callback handles the token exchange and stores the connection. If redirectUri was provided, the user is redirected there after a successful connection.
How It Works
- Your app calls
GET /v1/connect/{platform}to get an OAuth URL - Redirect the user to that URL (or open it in a new tab)
- The user authorizes on the platform (Twitter, YouTube, etc.)
- The platform redirects to PostPeer's callback
- PostPeer exchanges the code for tokens and stores them encrypted
- If
redirectUriwas set, the user is redirected back to your app
Status Codes
| Code | Meaning |
|---|---|
200 | OAuth URL generated |
403 | Platform not available |
500 | Platform credentials not configured |