CrumpetDev / crumpet

GNU Affero General Public License v3.0
18 stars 1 forks source link

A client can identify a person and retrieve their flows #66

Open tomtitherington opened 7 months ago

tomtitherington commented 7 months ago

Background & Context*

Once a client has a valid Websocket connection to the server, they should be able to retrieve details of a person and the state of their flows.

Goal*

Implementation Details*

Calls to this endpoint should be idempotent. Calling this endpoint multiple times with the same parameters should always result in the same outcome.

// Example request
{
    "action": "identify",
    "request_id" : Date.now(),
    "data": {
        "person_key": "string",
        "properties": "object"
    }
}

// Example response from "identify" action
{
  "request_id": 1519211809934,
  "errors": [],
  "status": 200,
  "data": {
    "person_id": "string",
    "flows": [
      {
        "flow_instance_id": "string",
        "flow_schema_identifier": "string",
        "state": "string (active, inactive, completed, exited)"
      }
    ]
  }
}

Acceptance Criteria*

Test cases that

Dependencies

Blockers:

Additional Details

Subscribing to flow / step state changes are not covered by this issue. A client will need to send another request type to subscribe to these changes.

*required field.