[ Docs ]
Connect your customers
Building an app on Postatron? Send your customers a link, and they connect their own social accounts without a Postatron login.
- Make a profileone per customer
- Make a linkPOST /v1/connect/sessions
- Customer signs inon the platform
- Back to your appstatus=connected
How it works
- 01
Make a profile for the customer
POST /v1/profileswith a name. Each customer's accounts live in their own profile, so their posts can never reach someone else's accounts. - 02
Make a connect link
POST /v1/connect/sessionswith the profile, the platforms to offer and yourredirect_url. The answer has aurland the sessionid. - 03
Send the customer to the link
Postatron's page says who is asking, by your redirect's address, and runs the platform's own sign-in. - 04
Get them back
They return to your redirect_urlwithstatus=connected, theaccount_id,platform,profileandsession, or withstatus=errorand the reason. - 05
Confirm it
Anyone can type a query string, so check with GET /v1/connect/sessions/{id}or wait for theaccount.connectedwebhook.
POST https://api.postatron.com/v1/connect/sessions
Authorization: Bearer ptn_...
{
"profile": "Bloom Studio",
"platforms": ["instagram", "linkedin"],
"redirect_url": "https://yourapp.com/connected"
}Good to know
A link works for an hour unless you ask for anything from 5 minutes to a day with expires_in, and stops working once an account is connected through it.Pass account_idinstead of platforms to have a customer sign in again to an account that needs reconnecting.The redirect must be https, or http on localhost while you build. The page is Postatron's, and the customer signs in through Postatron's apps on each platform. Connected accounts count towards your plan's allowance, so the link is refused up front if you have no room.