Skip to content

Get the Facebook login URL

GET
/v1/Accounts/{auth_id}/Integrations/Meta/Authorization
curl --request GET \
--url https://api.siprtc.io/v1/Accounts/example/Integrations/Meta/Authorization \
--header 'Authorization: Basic <credentials>'

Returns the Facebook login URL that connects a Facebook (Meta) account and its pages to this account for Messenger. A person must open url in a browser and approve; Facebook then redirects to the platform’s OAuth callback, which stores the pages the person manages (pages already connected to another account are skipped), subscribes each page to the app’s Messenger webhook, and redirects the browser to the return URL with status, pages_count and any skipped or unsubscribed pages in the query. The state embedded in url is signed and expires (15 minutes by default). The return URL is taken from return_url, else redirect_url, else the Referer header, and is used only when its host is on the platform’s allow-list; otherwise the platform’s default page is used. Requested Facebook permissions: pages_show_list, pages_manage_metadata, pages_read_engagement, pages_messaging. Nothing is stored until the callback succeeds. Authentication: HTTP Basic with the account’s Auth ID and Auth Secret. The operation always applies to the authenticated account; {auth_id} should be its Auth ID (with a parent account’s credentials on a sub-account’s path, the parent’s own integration is used, not the sub-account’s).

auth_id
required
string

Auth ID of the authenticated account

return_url
string

Where the browser goes after login (http/https URL on an allowed host)

redirect_url
string

Alias of return_url, used when return_url is absent or not allowed

OK

Media type application/json
object
redirect_uri

RedirectURI is where Facebook sends the browser after login (the platform’s OAuth callback).

string
state

State is the signed, time-limited OAuth state embedded in url; it names this account and the return URL.

string
url

URL is the Facebook login dialog to open in a browser.

string

Example

{
"redirect_uri": "https://api.siprtc.io/v1/Integrations/Meta/OAuth/Callback",
"state": "fake-state",
"url": "https://www.facebook.com/v23.0/dialog/oauth?client_id=000000000000000&redirect_uri=https%3A%2F%2Fapi.siprtc.io%2Fv1%2FIntegrations%2FMeta%2FOAuth%2FCallback&response_type=code&scope=pages_show_list%2Cpages_manage_metadata%2Cpages_read_engagement%2Cpages_messaging&state=fake-state"
}

The platform’s Facebook app is not configured

Media type application/json
object
message

Message says what went wrong.

string
status

Status is always “failed” on an error (some validation errors omit it).

string

Example

{
"message": "error message",
"status": "failed"
}

Missing or invalid credentials; the body is the JSON string Authentication failed

Media type application/json
string

Example generated

example