[ 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.

  1. Make a profileone per customer
  2. Make a linkPOST /v1/connect/sessions
  3. Customer signs inon the platform
  4. Back to your appstatus=connected

How it works

  1. 01

    Make a profile for the customer

    POST /v1/profiles with a name. Each customer's accounts live in their own profile, so their posts can never reach someone else's accounts.

  2. 02

    Make a connect link

    POST /v1/connect/sessions with the profile, the platforms to offer and your redirect_url. The answer has a url and the session id.

  3. 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.

  4. 04

    Get them back

    They return to your redirect_url with status=connected, the account_id, platform, profile and session, or with status=error and the reason.

  5. 05

    Confirm it

    Anyone can type a query string, so check with GET /v1/connect/sessions/{id} or wait for the account.connected webhook.

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_id instead 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.

A worked example is in the API reference.