Skip to main content
All CollectionsAPI Documentation
Connected Account - Wrk API Reference
Connected Account - Wrk API Reference

Secure access to 3rd party systems

David Li avatar
Written by David Li
Updated over a week ago

Connected Account

ENDPOINTS

GET

/connected_account

POST

/connected_account/auth_request

POST

/connected_account/{id}/set_default

The Connected Account object

Attributes

Attributes

The Connected Account object

  • id string
    A unique ID for the Connected Account

  • nickname string
    The human readable name for the Connected Account

  • app_reference string
    A unique reference for the Connected Account

  • status string
    The state of the Connected Account:

    • valid

    • invalid

    • pending

  • default boolean
    In case of multiple Connected Account, only one can be the default

  • auth_request_id int (optional)
    If applicable, the id of the authorization request

{
"id": "daDK1-x6547-2fzz-fd123",
"nickname": "App ABC",
"app_reference": "abc-online/auth",
"status": "valid",
"default": true,
"auth_request_id": null
}

Retrieve Connected Account

Retrieves Connected Account object(s) matching the provided parameters.

Parameters

  • id string (optional)
    The unique ID for the Connected Account

  • nickname string (optional)
    The human readable name for the Connected Account

  • app_reference string (optional)
    The unique reference for the Connected Account

  • status string (optional)
    The state of the Connected Account:

    • valid

    • invalid

    • pending

  • default boolean (optional)
    The default or non default Connected Account

  • auth_request_id int (optional)
    The ID of the authorization request

GET connected_account

Returns

connected_accounts contains a list of matching Connected Account object(s). The id is what is required to launch Wrkflow that require a Connected Account.

{
"totalCount": 2,
"connected_accounts": [
{
"id": "daDK1-x6547-2fzz-fd123",
"nickname": "App ABC",
"app_reference": "abc-online/auth",
"status": "valid",
"default": true,
"auth_request_id": null
},
{
"id": "",
"nickname": "Alternate ABC",
"app_reference": "abc-online/auth",
"status": "pending",
"default": false,
"auth_request_id": 3653
}
]
}

Connected Account Authorization Request

Request to authorize a Connected Account and create it once authorization has been received.

Parameters

  • app_reference string
    The unique identifier for the Connected Account

  • nickname string (optional)
    A human readable name for the Connect Account. If none provided - the name is set to "default"

POST connected_account/auth_request

Returns

The return value includes auth_request_id which can be used to track the status of the request. action_required contains a link that needs to be passed to the end user to go through the authorization process required. expiry_datetime is the expiry time in unix format that the request will remain open for the user to take action, after which it will be cancelled.

{
"status": "received",
"auth_request_id": "3213",
"expiry_datetime": 33432432432,
"action_required": "http://account.wrk.com/auth/etc?session=43242dasd"
}

Set a default Connected Account

A default Connected Account is required for every app_reference. The first Connected Account created for an app_reference is the de facto default one and subsequent ones are not. Use this endpoint to change the default Connected Account to a different one.

Parameters

  • id string
    The unique ID for the Connected Account

POST connected_account/{id}/set_default

Returns

If successful, a dictionary with Boolean property status where true denotes a successful receipt of the answer.

{ "status": true }
Did this answer your question?