API Reference
Get an access token
/v27.0/oauth/access_tokenhttps://meta-ads.mimicr.dev · provider: https://graph.facebook.comThree grants on one endpoint:
- Code exchange (
client_id,client_secret,redirect_uri,code): returns a 60-day user token.redirect_urimust be identical to the dialog's. - Long-lived token (
grant_type=fb_exchange_token,fb_exchange_token): returns a new token string with the same user, permissions and assets and a fresh 60-day expiry. The old token stays valid until its own expiry. An expired token can't be exchanged. - App token (
grant_type=client_credentials): returns{app_id}|{app_secret}.
The same params may be sent with POST in a form body.
In Mimicr, a configuration (config_id) whose token type is system user returns a token without expires_in that never expires. The persona unavailable makes the code exchange fail with a transient error (code 2, HTTP 500).
Authorization
Public route, no token.
Query parameters
The app ID.
The app secret.
Code exchange: the redirect_uri of the dialog.
Code exchange: the code of the redirect. Valid for 10 minutes, single-use.
fb_exchange_token or client_credentials. Omit for the code exchange.
fb_exchange_tokenclient_credentialsThe user token to exchange for a long-lived one.
Responses
200Access token.
The access token. With client_credentials, the app token {app_id}|{app_secret}.
"EAA…"bearerSeconds until the token expires: 5183944 (60 days) for user tokens. Absent for app and system user tokens, which don't expire.
5183944400101 unknown app, 1 wrong secret, 100 missing code, 100/36007 malformed or expired code, 100/36008 different redirect_uri, 100/36009 code already used, 190 invalid token to exchange.
Show child attributes
Description of the error.
"(#100) The parameter special_ad_categories is required"OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.
"OAuthException"Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).
100Error subcode with more detail (1885272 budget too low, 463 token expired, …).
1885272Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.
Title of the error, to show to people.
Message of the error, to show to people.
Extra data. blame_field_specs lists the params that caused a validation error.
Show child attributes
Internal support identifier of the request.
"AbCdEf12345"500Transient error: code 2 with is_transient: true. Retry later.
Show child attributes
Description of the error.
"(#100) The parameter special_ad_categories is required"OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.
"OAuthException"Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).
100Error subcode with more detail (1885272 budget too low, 463 token expired, …).
1885272Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.
Title of the error, to show to people.
Message of the error, to show to people.
Extra data. blame_field_specs lists the params that caused a validation error.
Show child attributes
Internal support identifier of the request.
"AbCdEf12345"