Get the Facebook login URL
const url = 'https://api.siprtc.io/v1/Accounts/example/Integrations/Meta/Authorization';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of the authenticated account
Query Parameters
Section titled “ Query Parameters ”Where the browser goes after login (http/https URL on an allowed host)
Alias of return_url, used when return_url is absent or not allowed
Responses
Section titled “ Responses ”OK
object
RedirectURI is where Facebook sends the browser after login (the platform’s OAuth callback).
State is the signed, time-limited OAuth state embedded in url; it names this account and the return URL.
URL is the Facebook login dialog to open in a browser.
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
object
Message says what went wrong.
Status is always “failed” on an error (some validation errors omit it).
Example
{ "message": "error message", "status": "failed"}Missing or invalid credentials; the body is the JSON string Authentication failed
Example generated
example