Establishments
Create a connection link
Returns a hosted link where the person authorizes a network with Sofia, so no network token reaches your app. Valid 30 minutes; live app only.
Create a hosted connection link and send the owner to it. The link is valid for 30 minutes; at the end, Sofia sends them back to your redirectUrl when it recognizes its origin.
curl -X POST https://api.sofia-post.com/api/v1/establishments/$ESTABLISHMENT_ID/connection-links \
-H "Authorization: Bearer $SOFIA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"platform":"linkedin","redirectUrl":"https://app.example.com/sofia/connected"}'A network that is already connected answers 409 account_already_connected; a network that Sofia does not offer answers 422 platform_not_offered.
Authorizations
AuthorizationstringheaderrequiredYour personal key or OAuth access token, sent as
Bearer <token>.
Path parameters
idstringrequiredIdentifier of the establishment.
Body
platformstringrequiredThe network to connect
Allowed values:
instagramfacebooktiktoklinkedinxredirectUrlstringWhere to send the person at the end, if Sofia recognizes this origin; otherwise a Sofia page tells them it is done
Response
The hosted connection link and its expiry.
platformstringrequiredThe network to connect
urlstringrequiredThe Sofia page the person opens to connect the network
expiresAtstringrequiredUntil when the link waits for a click (ISO 8601)