Skip to content
Proud to collaborate with Microsoft for Startups

bling.oauth-callback ​

Validates the OAuth state, exchanges the authorization code for access/refresh tokens at Bling, and delegates persistence to connection.setup.

Finalize a Bling OAuth connection from the redirect callback.

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-bling
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—Organization the OAuth flow was started for
codestringYes—Authorization code Bling returned to the callback
statestringYes—Signed state token issued by bling.oauth-start
actorstringNo—Caller identity (defaults to context.actor)
connection_namestringNo—Override connection_name; otherwise taken from state

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—Organization the OAuth flow was started for
codestringYes—Authorization code Bling returned to the callback
statestringYes—Signed state token issued by bling.oauth-start
actorstringNo—Caller identity (defaults to context.actor)
connection_namestringNo—Override connection_name; otherwise taken from state
redirect_uristringNo—Redirect URI verified from the state token
access_tokenstringNo—Bling access_token from code exchange
refresh_tokenstringNo—Bling refresh_token from code exchange
expires_atstringNo—ISO-8601 expiry of the access_token
scopestringNo—OAuth scope returned by Bling
connection_uuiduuidNo—UUID of the CloudConnection row produced by connection.setup
state_verified_atstringNo—ISO-8601 timestamp the state token was accepted
tokens_exchanged_atstringNo—ISO-8601 timestamp the code was exchanged
completed_atstringNo—ISO-8601 timestamp of overall completion
failure_reasonstringNo—Why this run failed (on the failed branch)
failed_atstringNo—ISO-8601 timestamp of failure
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepjsonNo——
failed_layerjsonNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—verify_stateCallback received
delegating_setupNoNo—completePersisting via connection.setup
exchanging_codeNoNo—delegate_setupTrading the authorization code for tokens at Bling
verifying_stateNoNo—exchange_codeVerifying signed state token
completedNoYesYes—Bling connection ready
failedNoYesNo—Bling OAuth callback failed

State Diagram ​

Transitions ​

FromActionToDescription
initiatedverify_stateverifying_state—
verifying_stateexchange_codeexchanging_code—
exchanging_codedelegate_setupdelegating_setup—
delegating_setupcompletecompleted—
initiatedfailfailed—
verifying_statefailfailed—
exchanging_codefailfailed—
delegating_setupfailfailed—

Business Errors ​

CodeMessage Template
BLING_INVALID_STATEInvalid or expired Bling OAuth state token:
BLING_STATE_ORG_MISMATCHOAuth state was issued for a different organization
BLING_CODE_EXCHANGE_FAILEDBling refused the authorization code:
BLING_SETUP_DELEGATION_FAILEDconnection.setup failed for Bling:

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "bling.oauth-callback",
  "initial_data": {
    "organization_uuid": "value",
    "code": "value",
    "state": "value"
  }
}