Learn how to integrate your application with OMI using OAuth 2.0 to securely access user data.
uid
) which can be used to interact with OMI APIs on behalf of the user.
App ID
. You also need to configure an App Home URL in your app’s settings within the OMI platform. This URL is where users will be redirected after successfully authorizing your application.
uid
). The user is then redirected back to your application’s App Home URL with the uid
and an optional state
parameter.https://api.omi.me/v1/oauth/authorize?app_id=YOUR_APP_ID&state=YOUR_OPAQUE_STATE_STRING
Parameters:
app_id
(required): Your application’s unique ID.state
(optional): An opaque value used to maintain state between the request and callback. This is useful for preventing CSRF attacks and can also store application-specific state. OMI will return this value to your application after the user authorizes your app./v1/oauth/authorize
URL, the user will be presented with an OMI page where they can:
POST
request to:
POST https://api.omi.me/v1/oauth/token
Request Body (form-data):
firebase_id_token
(required): The ID token obtained from Firebase after successful user login on the OMI page.app_id
(required): Your application’s unique ID.state
(optional): The state
parameter that was initially passed to the /v1/oauth/authorize
endpoint./v1/oauth/token
endpoint responds with a JSON object containing:
uid
: The unique identifier for the OMI user.redirect_url
: Your application’s configured App Home URL.state
: The state
parameter, if it was included in the initial authorization request.redirect_url
, uid
, and state
from the response to redirect the user’s browser to your application.
Example Redirect URL constructed by the client-side script:
uid
from the query parameters to identify the user. If you used a state
parameter, your application should validate it against the value it initially sent to protect against CSRF attacks.
/v1/oauth/token
processing.setup_completed_url
configured in its external_integration
settings, OMI will make a GET request to this URL (appending ?uid={user_uid}
). Your app’s setup_completed_url
endpoint must return a JSON response: {"is_setup_completed": true}
for the flow to proceed. If it returns false
or fails, an error will be shown.external_integration.app_home_url
field of your app’s configuration.