| Did you know ... | Search Documentation: |
| Pack bitrix24 -- docs/provider-contract.md |
pbitrix24 is provider-driven. The library does not store runtime auth state
internally and instead delegates config and context access to an external
provider module.
The consuming application should expose a module that implements:
get_config(Key, Value). load_context(ContextRef, Context). save_context(ContextRef, Context). delete_context(ContextRef). default_context(ContextRef).
The library works with two context reference forms:
global. member(MemberID).
default_context/1 should resolve the context reference used by api_call/4.
Providers should load and persist runtime context as a dict. The library uses a single normalized internal shape:
_{
member_id: MemberID,
access_token: AccessToken,
refresh_token: RefreshToken,
expires_at: ExpiresAt,
client_endpoint: ClientEndpoint,
server_endpoint: ServerEndpoint,
application_token: ApplicationToken,
user_id: UserID,
domain: Domain
}
These fields are required for REST calls and token refresh:
Providers must support:
oauth_token_url is not defined, the library defaults to:
'https://oauth.bitrix.info/oauth/token/'
expires_at internally, not expires.