Consumer API
>
API Reference
>
v0
>
Task Events
>
Details
openapi: 3.0.0
info:
version: '0.0'
title: Task Event Details
servers:
- url: 'https://{API_ENVIRONMENT}/a/consumer/api/v0'
variables:
API_ENVIRONMENT:
default: digital.garden-fi.com
description: FI specific hostname
tags:
- name: Task Events
paths:
'/users/{userId}/tasks/{taskId}':
get:
tags:
- Task Events
description: >-
Get all of a task's events. Holds the request for up to 7 seconds or
until a task event has been added.
security:
- OpenID_Connect:
- openid
parameters:
- $ref: '#/components/parameters/taskId'
- $ref: '#/components/parameters/userId'
- in: query
name: sinceVersion
description: Will only return events that have happened since sinceVersion.
required: false
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/GetTaskEvents'
'400':
description: sinceVersion is greater than the current version
'404':
description: Not found
components:
securitySchemes:
OpenID_Connect:
type: openIdConnect
description: OpenID Connect - Discovery endpoint will be institution specific
openIdConnectUrl: >-
https://digital.garden-fi.com/a/consumer/api/v0/oidc/.well-known/openid-configuration
parameters:
taskId:
in: path
name: taskId
description: The task's identifier
required: true
schema:
type: string
userId:
in: path
name: userId
description: The user guid
required: true
schema:
type: string
schemas:
GetTaskEvents:
type: object
description: ''
required:
- version
- events
properties:
version:
description: The current version of the task
type: number
example: 2
events:
type: array
description: ''
items:
$ref: '#/components/schemas/TaskEvent'
TaskEvent:
type: object
description: A simple Task Event Object
required:
- type
- ...
properties:
type:
type: string
description: Task Event type
example: EventOne
...:
type: string
description: Task events have many different properties based on the event type.
example: ...
Basic Task Events
All tasks have a TaskStarted task event for when that task started:
There are two methods of retrieving a task’s events: Blocking and a
plain GET.
- The endpoint that takes a sinceVersion parameter blocks for up to
7 seconds until it sees another task event and returns task events
since the version parameter.
- The "plain get" without the sinceVersion parameter just returns
everything it currently has with no blocking.
It is much preferable to use the blocking request over polling a
plain GET request as results will be realtime and much less strain on
the server and client.
Have a Question?
Have a how-to question? Seeing a weird error? Get help on
StackOverflow.
Register for the Digital Toolkit Meetup
where we answer technical Q&A from the audience.