GALANTHUS / ABI FUNCTION REFERENCE
gln_revolut_oauth_authorize_url
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_revolut_oauth_authorize_url(
gln_backend_t* in_backend,
const char* in_state,
char** out_authorize_url,
gln_error_t* out_error);
Purpose
Builds the Revolut Business OAuth authorization URL for an opened Revolut backend.
The returned URL includes the caller-supplied state and is suitable for handing to the host application's browser or redirect flow.
Return
Returns GLN_OK on success and a non-OK gln_status_t value on failure.
| Type | Nullability | Ownership |
|---|---|---|
gln_status_t | value | value |
Parameters
| Name | Direction | Type | Nullability | Ownership |
|---|---|---|---|---|
in_backend | input | gln_backend_t* | nonnull | borrowed |
in_state | input | const char* | nonnull | borrowed |
out_authorize_url | output | char** | nonnull | transferred_out |
out_error | output | gln_error_t* | nullable | caller_allocated_output |
Behavior
This call does not contact Revolut and does not read or write token storage.
in_backend must be a Revolut backend opened with gln_open_revolut_backend; passing another backend family returns GLN_ERR_NOT_SUPPORTED.
in_state must be a non-empty caller-generated correlation value. The library copies it into the generated URL but does not retain it.
Ownership
On success, out_authorize_url receives a caller-owned string. Release it with gln_release_string.
The function clears *out_authorize_url to NULL before validation when the output slot itself is non-NULL.
Example
char* authorize_url = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t rc = gln_revolut_oauth_authorize_url(
backend,
"caller-generated-oauth-state",
&authorize_url,
&error);
if (rc == GLN_OK) {
open_authorization_page(authorize_url);
}
gln_release_string(authorize_url);
gln_release_error(&error);