All requests to the Meridian API must include a Bearer token in the HTTP header:
Meridian uses OAuth 2.0 with Proof Key for Code Exchange (PKCE) for secure authentication.
Generate a code verifier which is then encoded with SHA-256 to produce the code challenge.
You can use tools like PKCE Code Generator.
To authorize a user, make a redirect/GET request to the o/authorize/ endpoint with the following query parameters:
If all data is correct, the user will be redirected to an authorization page. If they are not logged in, they will need to login to the Meridian app first, then confirm the authorization.
After the user confirms and clicks Authorize, they will be redirected to the URL specified in the redirect_uri parameter with a code string in the query parameter: ?code=<code>.
Use this code to make a POST request to the o/token/ endpoint to get the access token:
Use the access_token in the header - Bearer ACCESS_TOKEN to make authenticated requests.
If the user cancels the authorization, they will be redirected back to the same redirect_uri with the query parameter: ?error=access_denied.
Access tokens have an expiration time (expires_in). Once the access token expires, the client can use the refresh_token to request a new access token without requiring the user to authorize again.
To refresh the token, make a request to o/token/ with the following parameters: