Unifii API

Status: DRAFT

Overview

This document describes how to retrieve definitions and data for applications and forms built on top of the Unifii Platform.

Status

This document is in the draft state. It might not be complete and is subject to changes before the final release.

  • To do:

    • Replace the HOST throughout the document with something other than dev.unifii.net.
    • Change the examples throughout the document to a more sensible project, maybe continuing the “feedback form” idea.
  • Inconsistency in the API:

    • The RQL implementation doesn’t allow any way of specifying empty string or array values.
  • Errors in content-interfaces.ts with respect to the observed results from API calls:

    • Interface Structure has rev required that doesn’t exist in the response from /structure
    • Interface Definition doesn’t match the response from /collections
    • Interface Compound doesn’t match the response from /collections/{identifier}
    • Interface Page doesn’t match the response from /pages and /pages/{identifier}

Background

Forms in Unifii are represented by their definition document. This document specifies the fields and their order, and this information is used to render them. It may also contain validation rules, layout attributes and workflow states and actions.

Here’s a simple example of the definition of a form. This is a feedback form with three fields.

{
    "label": "Feedback",
    "identifier": "feedback",
    "bucket": "feedback",
    "fields": [
        {
            "type": "Text",
            "label": "Name",
            "identifier": "name"
        },
        {
            "type": "Choice",
            "label": "Feedback Type",
            "identifier": "feedbackType",
            "placeholder": "Please choose",
            "options": [
                {
                    "identifier": "Compliment",
                    "name": "Compliment"
                },
                {
                    "identifier": "Complaint",
                    "name": "Complaint"
                },
                {
                    "identifier": "Other",
                    "name": "Other"
                }
            ]
        },
        {
            "type": "MultiText",
            "label": "Message",
            "identifier": "message"
        }
    ]
}

Once completed, this form would produce a dictionary as follows:

{
    "name": "Bilbo",
    "feedbackType": "Other",
    "message": "Not all those who wander are lost"
}

The identifier of each field becomes a key in the dictionary and the user’s input becomes its value.

Bucket storage

In order to facilitate rapid application development using Unifii forms, Unifii provides a schemaless document storage for data captured by the forms.

Storage is organised into buckets (equivalent to tables in the SQL world). The most common scenario is 1:1, where 1 form corresponds to 1 bucket. However, in certain situations, it may make a more sense to go with an N:1 setup, where the data from multiple forms are stored in 1 bucket.

In the example above, you can see that the Feedback form is associated with the feedback bucket.

Authentication

The vast majority of the Unifii endpoints require authentication. Unauthenticated requests result in HTTP status code 401 Unauthorized.

The caller may be either a user or else an external system identified by an API Key.

User Authentication

For user-based authentication, each request must send the user’s OAuth bearer token.

Authorization: Bearer {token}

API Key Authentication

The authentication scheme for API Keys is based on message signing (HMAC-SHA256), using a shared secret. The client sends the API Key, and signs the request using the API Secret. Unifii verifies the request and the signature, upon receiving the request.

The API Key and the API Secret can be generated in Unifii Console under your project -> Settings -> API Keys -> Plus button. You need to have the ProjectManager role to access this functionality.

The HTTP header is defined like this:

Authorization: UNIFII {apiKey}:{signature}

Please see below how the signature is computed.

Unless otherwise noted, every request in this document needs to have this Authorization HTTP header.

Requests also need a timestamp header in the following format:

X-Unifii-Date: yyyy-MM-ddThh:mm:ssZ

The timestamp is verified by Unifii. All requests are valid for 10 minutes only.

The signature is defined as follows (pseudocode):

signature = base64(hmacSha256(stringToSign, apiSecret))

stringToSign =  {method} + '\n' + // GET, PUT, POST, DELETE, PATCH, ...
                {path} + '\n' + // URL path starting with a slash, e.g. /v1/projects/1/buckets -- use '/' for root
                {query} + '\n' + // query string without the question mark
                host:{host} + '\n' + // host header value, e.g. xxxxx.unifii.net
                content-type:{contentType} + '\n' // Content-Type header value -- use empty string if content-type will not be present
                accept-language:{lang} + '\n' // Accept-Language header value -- use empty string if the header is not present
                {date} + '\n' + // timestamp from X-Unifii-Date header

Example request:

GET https://xxxxx.unifii.net/v1/path?var=value%20with%20spaces HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Host: xxxxx.unifii.net


This would produce the following stringToSign. Note that there’s a new line at the end:

GET
/v1/path
var=value%20with%20spaces
host:xxxxx.unifii.net
content-type:
accept-language:
2017-06-30T00:27:58Z

The resulting signed request would be as follows in the Authorization header (using ApiKey for the API Key, followed by a colon and the signature):

GET https://xxxxx.unifii.net/v1/path?var=value%20with%20spaces HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Authorization: UNIFII ApiKey:RXAIGsnacjnC3HZwqON/OWtnyd6KW0ov7Itc+UgaQhc=
X-Unifii-Date: 2017-06-30T00:27:58Z
Host: xxxxx.unifii.net


Authorization

Having been authenticated successfully, the user or API Key’s permissions will be checked for the request. Unauthorized access will result in HTTP status code 403 Forbidden.

These permissions are configured in Unifii Console under User Management -> Users or Roles -> Permissions. You need to have the UserManager role to access this functionality.

Errors

The Unifii API returns standard HTTP response codes to indicate success or failure.

  • Codes in the 2xx range indicate that an API request has succeeded.

  • Codes in the 4xx range indicate that the request has failed due to a problem with the information provided. The request may be retried after correcting it according to the information that was returned in the response.

  • Codes in the 5xx range are exceptional, indicating an error in the Unifii platform. The same request may succeed if retried, once the error has been rectified.

Preview versus Live API Calls

In the documentation below, many of the APIs appear in pairs:

  • The preview APIs have /preview in the URLs. They access content and forms that have been published for previewing or testing.

  • The live APIs have simpler URLs. They access content and forms that have been published for production.

Although the preview and live data are completely separate, their behaviour is identical.

Filtering, Sorting and Pagination

Many of the Unifii API calls return lists of objects. Filtering and sorting can be applied to the results of some calls. The results can also be paginated to limit the number of objects retrieved by each call.

Filtering, sorting and pagination are useful for calls that might return a large number of objects. There might be a lot of submitted forms in a bucket, for example.

While reading the documentation for these API calls, keep this distinction in mind:

  • When a call supports these capabilities, the documentation states that it lists some of the objects; e.g., you can list some form data.

  • Calls that do not support them are documented as listing all of the objects.

Query Parameters

The Unifii API supports these capabilities by means of query parameters that may be appended to a call. The syntax for these parameters is a subset of Resource Query Language (RQL for short).

RQL consists of operators.

  • Each operator has a name, e.g., eq for equals.

  • The name is followed by a list of arguments in parentheses. Commas separate the arguments, e.g., eq(_state,Published).

    • Each argument may be a property, a value, an array, or another operator.
    • Use dot notation to refer to a nested property, e.g., eq(address.state,NSW).
  • Operators can be nested, e.g., or(eq(_state,Draft),eq(_state,Published)). Nested operators constrain the surrounding operator.

Values are formatted as follows.

  • Be sure to URL-encode all values.

  • Do not use quotes around string values or dates and times.

  • All times and dates are local (relative to the person filling out the form) unless they have a timezone offset, e.g., a suffix like +00:00 or Z. Please see RFC3339 for the format reference.

  • An array is a set of items, surrounded by parentheses, e.g., in(_state,(Draft,Published)). Each item in the array can be a value or an operator.

  • The data type of each value can be explicitly specified, e.g., eq(_definitionVersion,number:2)&eq(_state,string:Start)&eq(ready,bool:true).

Filtering

The operators below can be used to filter results.

Operator Description
= This is shorthand for the eq operator.
  • Example: /buckets/wager?dollars=20
eq(property,value) Matches objects where the property is equal to value.
  • Example: /buckets/wager?eq(dollars,20)
ne(property,value) Matches objects where the property is not equal to value.
  • Example: /buckets/wager?ne(dollars,20)
gt(property,value) Matches objects where the property is greater than value.
  • Example: /buckets/wager?gt(_lastModifiedAt,2017-06-30T00%3A00%3A00)
  • %3A above is the URL-encoded colon character.
ge(property,value) Matches objects where the property is greater than or equal to value.
lt(property,value) Matches objects where the property is less than value.
le(property,value) Matches objects where the property is less than or equal to value.
in(property,(array-of-values)) Matches objects where the property is in the provided array.
  • Example: /buckets/wager?in(dollars,(20,21))
contains(property,value) Matches objects where the property is an array that contains value.
contains(property,(array-of-values) Matches objects where the property is an array that contains a value in the provided array.
q(value) Matches objects where any of the objects’ searchable properties start with value.

Sorting

Only one property can be specified for sorting. If sorting is not specified, then the order of the results is undefined.

Operator Description
sort(+property) Sorts the results by a property in ascending order.
  • Example: /buckets/wager?sort(+_lastModifiedAt)
sort(-property) Sorts the results by a property in descending order.
  • Example: /buckets/wager?sort(-_lastModifedAt)

Pagination

The results can be retrieved a “page” at a time. This can be much faster than retrieving all of the results in one call.

Operator Description
limit(count,offset) Returns count objects starting from offset. The offset argument is optional.
  • Default: limit(100,0)
  • Example: /buckets/wager?limit(20,100)

Combining queries

Operator Description
& This is shorthand for the and operator.
  • Example: /buckets/wager?ge(_lastModifiedAt,2017-06-01)&sort(+_lastModifiedAt)&limit(10,0)
and(query,query,...) Restricts its sub-queries’ results. This is the intersection of the sub-queries’ results.
or(query,query,...) Combines its sub-queries’ results. This is the union of its sub-queries’ results.
not(query) Negates its sub-query’s result.

There are some restrictions on how queries can be combined:

  • = and & can only be used at the top level.

    • An illegal example would be or(a=b,eq(a,c)&ne(a,d)), because you cannot nest the shorthand operators inside other operators.
  • sort and limit can only be used at the top level. Furthermore, they can only be combined with and or &, as in the example above.

    • An illegal example would be or(sort(+_lastModifedAt),limit(10,0)), because they would be ignored inside the or operator.
    • Only the first sort and limit are applied. Extra sort or limit operators would be ignored.

Your API Key may have conditional permissions defined for a bucket you’re accessing. These conditions will interact with your submitted query. Permission conditions impose an additional filter to ensure data isn’t leaked to unauthorized clients. For example:

  • If a permission specifies a condition that restricts you to view only draft data;

  • But your request is filtered for published data;

  • Then, internally, the combined filter will be something like this:

    • and(eq(_state,Draft),eq(_state,Published))

The result of this combined filter would always be empty.

Users

Unifii features a federated identity system. Users can be internal (credentials stored in Unifii) or externally authenticated against an Identity Provider such as Azure AD.

User Model

{
  "id": "1234",
  "username": "bruce",
  "firstName": "Bruce",
  "lastName": "Wayne",
  "email": "batman@example.com",
  "phone": "0450 111 111",
  "changePasswordOnNextLogin": false,
  "isExternal": false,
  "isActive": true,
  "hasPassword": true,
  "createdAt": "2016-06-15T04:50:11.3419517+00:00",
  "lastModifiedAt": "2020-07-24T07:57:09.0626728+00:00",
  "lastModifiedBy": "bruce",
  "roles": [
    "Manager",
    "Admin",
    "Previewer",
    "SuperHero"
  ],
  "claims": [
    {
      "type": "Location",
      "value": "Gotham City"
    },
    {
      "type": "Nickname",
      "value": "Dark Knight"
    }
  ]
}

Claims are key-value pairs that represent additional properties of a user object. Claim types are not unique and can repeat.

List Users

This endpoint accepts RQL queries as defined above.

GET https://{tenant}.unifii.net/v1/users
Responses200401403404
Headers
Content-Type: application/json
Body
[
    {
        "id": "1234",
        "username": "bruce",
        "firstName": "Bruce",
        "lastName": "Wayne",
        "email": "batman@example.com",
        "phone": "0450 111 111",
        "changePasswordOnNextLogin": false,
        "isExternal": false,
        "isActive": true,
        "hasPassword": true,
        "createdAt": "2016-06-15T04:50:11.3419517+00:00",
        "lastModifiedAt": "2020-07-24T07:57:09.0626728+00:00",
        "lastModifiedBy": "bruce",
        "roles": [
            "Manager",
            "Admin",
            "Previewer",
            "SuperHero"
        ],
        "claims": [
            {
                "type": "Location",
                "value": "Gotham City"
            },
            {
                "type": "Nickname",
                "value": "Dark Knight"
            }
        ]
    },
    ...
]
This response has no content.
This response has no content.
This response has no content.

GET/v1/users

Returns an array of users based on specified filter. Default limit is 20, maximum is 100.

Supported query parameters:

Parameter eq ne in contains gt ge le lt sort
id
username
firstName
lastName
email
roles
claims.{type}
createdAt
lastModifiedAt

Examples:

Get all users with role Admin:

/v1/users?contains(roles,Admin)

Get all users with a Location claim equal to Gotham:

/v1/users?eq(claims.Location,Gotham)

Paginate:

/v1/users?limit(100,0)
/v1/users?limit(100,100)
/v1/users?limit(100,200)
...

Get users that have been modified since date/time sorted by oldest first:

/v1/users?gt(lastModifiedAt,2020-07-01)&sort(+lastModifiedAt)

Get User by ID

Gets user object based on its primary key.

GET https://{tenant}.unifii.net/v1/users/1234
Responses200401403404
Headers
Content-Type: application/json
Body
{
  "id": "1234",
  "username": "bruce",
  "firstName": "Bruce",
  "lastName": "Wayne",
  "email": "batman@example.com",
  "phone": "0450 111 111",
  "changePasswordOnNextLogin": false,
  "isExternal": false,
  "isActive": true,
  "hasPassword": true,
  "createdAt": "2016-06-15T04:50:11.3419517+00:00",
  "lastModifiedAt": "2020-07-24T07:57:09.0626728+00:00",
  "lastModifiedBy": "bruce",
  "roles": [
    "Manager",
    "Admin",
    "Previewer",
    "SuperHero"
  ],
  "claims": [
    {
      "type": "Location",
      "value": "Gotham City"
    },
    {
      "type": "Nickname",
      "value": "Dark Knight"
    }
  ]
}
This response has no content.
This response has no content.
This response has no content.

GET/v1/users/{userId}

Returns a single user.

URI Parameters
HideShow
userId
string (required) Example: 1234

Get User by Username

Gets user object based on supplied username.

GET https://{tenant}.unifii.net/v1/users/username/bruce
Responses200401403404
Headers
Content-Type: application/json
Body
{
  "id": "1234",
  "username": "bruce",
  "firstName": "Bruce",
  "lastName": "Wayne",
  "email": "batman@example.com",
  "phone": "0450 111 111",
  "changePasswordOnNextLogin": false,
  "isExternal": false,
  "isActive": true,
  "hasPassword": true,
  "createdAt": "2016-06-15T04:50:11.3419517+00:00",
  "lastModifiedAt": "2020-07-24T07:57:09.0626728+00:00",
  "lastModifiedBy": "bruce",
  "roles": [
    "Manager",
    "Admin",
    "Previewer",
    "SuperHero"
  ],
  "claims": [
    {
      "type": "Location",
      "value": "Gotham City"
    },
    {
      "type": "Nickname",
      "value": "Dark Knight"
    }
  ]
}
This response has no content.
This response has no content.
This response has no content.

GET/v1/users/username/{username}

Returns a single user.

URI Parameters
HideShow
username
string (required) Example: bruce

Form Buckets

Form buckets are where partially completed and completed forms are stored.

Each form usually has its own separate bucket. Multiple forms can collect in one bucket, however, which is useful if similar forms need to be viewed at the same time.

Bucket Transaction Log

The transaction log records all form submissions (including previous revisions) in chronological order over time. It’s designed for efficient polling for synchronisation purposes. It allows clients to incrementally process or synchronise form data.

No restriction on poll frequency is enforced at the moment, however, Unifii reserves the right to change rate limits and their enforcement. Unifii’s recommendation is to poll once a minute at most. If your use case does not require immediate updates, please consider reducing polling frequency.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/_log?from=016d042016fa1a0b4399c611&bucket=register-for-full-access&id=53dfba0f-f9c5-481b-acb6-03c2d5e7d265
Responses200
Headers
Content-Type: application/json
Body
[
    {
        "_rev": "016d042016fa1a0b4399c612",
        "_lastModifiedAt": "2019-09-06T01:11:14.938+00:00",
        "id": "53dfba0f-f9c5-481b-acb6-03c2d5e7d265",
        "_seq": 1,
        "name": "Mithun",
        "_seqId": "REG - 00001",
        "_state": "Submit",
        "_action": "Submit",
        "_bucket": "register-for-full-access",
        "_history": [
        {
            "state": "Start",
            "action": "Submit"
        }
        ],
        "userName": "Mithun",
        "_openedAt": "2019-09-06T01:10:55.523+00:00",
        "_createdAt": "2019-09-06T01:11:14.938+00:00",
        "_createdBy": "TestDssSafety",
        "_completedAt": "2019-09-06T01:11:14.781+00:00",
        "officialEmail": "mithun.desai@consultdss.com",
        "_lastModifiedBy": "TestDssSafety",
        "_definitionVersion": 1,
        "_definitionIdentifier": "register-for-full-access"
    },
    {
        "_rev": "016d045852f51a0b4399c613",
        "_lastModifiedAt": "2019-09-06T02:12:40.309+00:00",
        "id": "6ba65384-e60d-4b5d-9536-8d5e71b22d4b",
        "_seq": 2,
        "name": "Subbu M V ",
        "_seqId": "REG - 00002",
        "_state": "Submit",
        "_action": "Submit",
        "_bucket": "register-for-full-access",
        "_history": [
        {
            "state": "Start",
            "action": "Submit"
        }
        ],
        "userName": "Subbu",
        "_openedAt": "2019-09-06T02:11:09.216+00:00",
        "_createdAt": "2019-09-06T02:12:40.309+00:00",
        "_createdBy": "TestDssSafety",
        "_completedAt": "2019-09-06T02:12:38.075+00:00",
        "officialEmail": "subba.mv@consultdss.com",
        "_lastModifiedBy": "TestDssSafety",
        "_definitionVersion": 1,
        "_definitionIdentifier": "register-for-full-access"
    },
    ...
]

GET/v1/projects/{projectId}/buckets/_log?from={from}&bucket={bucket}&id={id}

GET /v1/projects/{projectId}/preview/buckets/_log?from={from}&bucket={bucket}&id={id}

Retrieves documents using specified filter. Ordered by _rev which is the primary key.

URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

from
string (optional) Example: 016d042016fa1a0b4399c611

Last known processed revision _rev (exclusive). Enables pagination / download in batches.

bucket
string (optional) Example: register-for-full-access

Bucket filter. Filters on _bucket property.

id
string (optional) Example: 53dfba0f-f9c5-481b-acb6-03c2d5e7d265

Document id filter. Returns all versions of a particular document.


List all Buckets

Lists the identifiers of all of the buckets in the given project.

GET https://{tenant}.unifii.net/v1/projects/61/buckets
Responses200401403404
Headers
Content-Type: application/json
Body
[
  {
    "id": "wager"
  },
  {
    "id": "form2"
  }
]
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets

Returns an array of FormBucket objects if the call succeeds.

FormBucket

Attribute name Type Description
id string (required)
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.


Get a Bucket's Schema

Retrieves the schema of a bucket. The schema shows the structure of the data contained within a bucket. The schema is derived from all of the forms associated with the bucket.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/wager/_schema
Responses200401403404
Headers
Content-Type: application/json
Body
{
  "bucket": "wager",
  "fields": [
    {
      "type": "Lookup",
      "label": "Horse",
      "identifier": "horse",
      "isSearchable": false,
      "dataSource": "horses"
    },
    {
      "type": "Text",
      "label": "Dollars",
      "identifier": "dollars",
      "isSearchable": false
    }
  ],
  "transitions": []
}
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/{bucket}/_schema

GET /v1/projects/{projectId}/preview/buckets/{bucket}/_schema

Returns a Schema object if the call succeeds.

Schema

Attribute name Type Description
bucket string (required)
fields array of SchemaField (required)
transitions array of SchemaTransition (required)
Hide details Show details

SchemaField

Attribute name Type Description
type string (required) The type of field is one of:
  • Text
  • MultiText
  • Cost
  • Currency
  • Date
  • Time
  • DateTime
  • Number
  • Phone
  • Email
  • Website
  • Bool
  • Choice
  • MultiChoice
  • ImageList
  • SoundList
  • VideoList
  • FileList
  • GeoLocation
  • Content
  • Address
  • Signature
  • Separator
  • Group
  • Repeat
  • Section
  • ActionGroup
  • Lookup
  • Link
  • LinkList
  • DefinitionLink
  • Event
label string (required)
isSearchable boolean (required)
identifier string When displayFor is not available
displayFor string When identifier is not available
fields array of SchemaField
dataSource string
options array of Option

SchemaTransition

Attribute name Type Description
source string (required)
action string (required)
target string (required)

Option

Attribute name Type Description
identifier string (required)
name string (required)
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

bucket
string (required) Example: wager

The identifier of the bucket.


List some Data Items

Lists some or all of the data contained in a bucket.

The data can be filtered, sorted and paginated to limit the amount of data retrieved by each call.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/wager
Responses200401403404
Headers
Content-Type: application/json
Body
[
  {
    "_createdAt": "2018-11-08T06:19:21.173+00:00",
    "_createdBy": "peter",
    "_definitionIdentifier": "wager",
    "_definitionVersion": 1,
    "_history": [],
    "_lastModifiedAt": "2018-11-08T06:19:21.173+00:00",
    "_lastModifiedBy": "peter",
    "_state": "Start",
    "dollars": "20",
    "id": "2620f348-55b3-4036-a5ee-63c12cc69a9b"
  }
]
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/{bucket}

GET /v1/projects/{projectId}/preview/buckets/{bucket}

Returns an array of Data objects if the call succeeds.

Data

Attribute name Type Description
id string
_createdAt string
_createdBy string
_lastModifiedAt string
_lastModifiedBy string
_definitionIdentifier string (required)
_definitionVersion number (required)
_state string
_action string
_result string
_history array of object Each object consists of:
  • state: string
  • action: string
_rev string Data history revision
_storedAt string Offline form
Data A mapping of string keys to any (required) Each of these keys defines a data value within the whole object.
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

bucket
string (required) Example: wager

The identifier of the bucket.


Get a Data Item

Retrieves a single item of data contained in a bucket.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/wager/2620f348-55b3-4036-a5ee-63c12cc69a9b
Responses200401403404
Headers
Content-Type: application/json
Body
{
  "_createdAt": "2018-11-08T06:19:21.173+00:00",
  "_createdBy": "peter",
  "_definitionIdentifier": "wager",
  "_definitionVersion": 1,
  "_history": [],
  "_lastModifiedAt": "2018-11-08T06:19:21.173+00:00",
  "_lastModifiedBy": "peter",
  "_state": "Start",
  "dollars": "20",
  "id": "2620f348-55b3-4036-a5ee-63c12cc69a9b"
}
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/{bucket}/{id}

GET /v1/projects/{projectId}/preview/buckets/{bucket}/{id}

Returns a Data object if the call succeeds.

Content Types

Type Description
application/json Default
application/pdf Returns data item as pdf. Set ‘Accept’ header on request to ‘application/pdf’
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

bucket
string (required) Example: wager

The identifier of the bucket.

id
string (required) Example: 2620f348-55b3-4036-a5ee-63c12cc69a9b

The identifier of the item of data.


List all Revisions of a Data Item

Retrieves all of the revisions of a data item within a bucket.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/wager/2620f348-55b3-4036-a5ee-63c12cc69a9b/revisions
Responses200401403404
Headers
Content-Type: application/json
Body
[
  {
    "_rev": "8badfe53-54d4-4eb9-b977-f94f3da56583"
  }
]
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/{bucket}/{id}/revisions

GET /v1/projects/{projectId}/preview/buckets/{bucket}/{id}/revisions

Returns an array of Revision objects if the call succeeds.

Revision

Attribute name Type Description
_rev string (required)
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

bucket
string (required) Example: wager

The identifier of the bucket.

id
string (required) Example: 2620f348-55b3-4036-a5ee-63c12cc69a9b

The identifier of the item of data.


Get a Revision of a Data Item

Retrieves a single revision of a data item within a bucket.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/wager/2620f348-55b3-4036-a5ee-63c12cc69a9b/revisions/8badfe53-54d4-4eb9-b977-f94f3da56583
Responses200401403404
Headers
Content-Type: application/json
Body
{
  "_createdAt": "2018-11-08T06:19:21.173+00:00",
  "_createdBy": "peter",
  "_definitionIdentifier": "wager",
  "_definitionVersion": 1,
  "_history": [],
  "_lastModifiedAt": "2018-11-08T06:19:21.173+00:00",
  "_lastModifiedBy": "peter",
  "_state": "Start",
  "dollars": "20",
  "id": "2620f348-55b3-4036-a5ee-63c12cc69a9b"
}
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/{bucket}/{id}/revisions/{rev}

GET /v1/projects/{projectId}/preview/buckets/{bucket}/{id}/revisions/{rev}

Returns a Data object if the call succeeds.

Content Types

Type Description
application/json Default
application/pdf Returns data item as pdf. Set ‘Accept’ header on request to ‘application/pdf’
URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

bucket
string (required) Example: wager

The identifier of the bucket.

id
string (required) Example: 2620f348-55b3-4036-a5ee-63c12cc69a9b

The identifier of the data item.

rev
string (required) Example: 8badfe53-54d4-4eb9-b977-f94f3da56583

The revision to get.


Get an Attachment

Retrieves a file that is attached to some data.

GET https://{tenant}.unifii.net/v1/projects/61/buckets/_files/cc605b16-cc56-4812-906f-51e45763f939
Responses200401403404
Headers
Content-Type: image/png
Content-Disposition: inline; filename="Screen Shot 2017-06-07 at 10.42.38 AM.png"
Body
... binary data
This response has no content.
This response has no content.
This response has no content.

GET/v1/projects/{projectId}/buckets/_files/{id}

GET /v1/projects/{projectId}/preview/buckets/_files/{id}

Returns the binary contents of the file if the call succeeds. The Content-Type header will be set based on the type of file.

URI Parameters
HideShow
projectId
string (required) Example: 61

The identifier of the project.

id
string (required) Example: cc605b16-cc56-4812-906f-51e45763f939

The identifier of the file to retrieve.


Generated by aglio on 18 Jul 2023