Interactive API (2020-03-05T14:00:01Z)

Download OpenAPI specification:Download

Introduction

The Interactive RESTful API can be used to create manage interactive documents and instances.

Interactive Templates allow human interaction in processes that need to generate documents or send communications.

This service can be used for:

  • Interactive Composition: Allow limited editing before sending out a communication (optional paragraphs, alternatives, editing of particular paragraphs) by Employees.
  • Actionable Communications: Allows Consumers to take action directly from within the communication itself, like drilling down, getting additional information, filling in questionnaires or browsing through a catalog.

The base URL for the Xribe interactive RESTful API is https://interactive.compose.platform.unifiedpost.com/api

Typical application flow

The typical application flow for an interactive application is:

  1. Get access token: Fetch a OAuth Bearer token from the login server (https://login.inventivedesigners.com). This OAuth Bearer token should be provided as the Authorization header to all non-public API endpoints
  2. Get most recent documents: Used to retrieve the Document ID that will be used to create an Instance. This endpoint uses pagination, an additional call with the lastEvaluatedKey from the previous call is required if the document is not yet found.
  3. Create new Instance: Create an instance using the Document ID retrieved in the previous step and the JSON data.
  4. Create New Instance Session: Create an instance session, an open instance session is required to make changes to the interactive instance. An instance session is assigned to a specific user. Opening a session when there is already an open session will fail. (It is best practice to close the session when the user is done making changes.)
  5. Interactive Instance Editor: At this point you can open the Interactive Instance Editor in your application using an iframe with the following URL https://{environmentID}.interact.compose.platform.unifiedpost.com/?instanceID={instanceID}&projectID={projectID}&environmentID={environmentID} (replace the variables environmentID, projectID, and instanceID with the corresponding UUIDs)
  6. You can use the preview endpoint to generate a preview of the Interactive Instance. The preview endpoint will return an URL that can be used as the src of an iframe to display a preview of the final output.
  7. Final output: You can use the Xribe Output API to generate the final output of the interactive instance.

Authentication

All requests to the Xribe Interactive API must be authenticated. See OAuth 2.0 for information on how to obtain security tokens and Performing authenticated requests on how to use them.

The Xribe Interactive API uses https://login.inventivedesigners.com as its authentication and authorization server.

Authorization

Users that make calls to the Xribe Interactive API should have permission interactive. In addition to this they should also have access to the different resources.

Api endpoint Operation Resource
getInstance(s) read project://<accountName>/<projectID>/<environmentID>
createInstance write project://<accountName>/<projectID>/<environmentID>
deleteInstance write project://<accountName>/<projectID>/<environmentID>
getDocument
getTheme
getResources
getSession read project://<accountName>/<projectID>/<environmentID>
createSession write project://<accountName>/<projectID>/<environmentID>
closeSession write project://<accountName>/<projectID>/<environmentID>
getInstanceData
preview write project://<accountName>/<projectID>/<environmentID>
re-index write project://<accountName>/<projectID>/<environmentID>

Glossary

Term Description
Interactive Document Created from a Template and a theme. Use re-index to update the documents when changes are made to templates, themes, Pluggable Objects, or Content Blocks.
Interactive Instance A specific instance of document together with JSON data, which will be used to generate the final output/communication.
Instance Session There needs to be an open Instance Session before changes can be made to an Interactive Instance. Creating an Instance Session will also automatically create a new Instance Version.
Instance Version A version of an Interactive Instance will point to a particular version of the document and the JSON data. This allows you to always know when a particular change was made to an Interactive Instance.

Documents

Manage your Interactive Documents.

Get the most recent Interactive Documents

Get the 100 most recent Interactive Documents.

Authorizations:
OAuth2
query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

lastEvaluatedKey
string

Used for pagination. Provide the returned lastEvaluatedKey of a previous listing to get the next 100 items. When the parameter is omitted, the first 100 items will be returned.

Responses

Response Schema: application/json
lastEvaluatedKey
required
string (The last evaluated key, can be provided on a following call as a request parameter to get the next set of items.)
required
Array of objects (The Documents Schema)

Response samples

Content type
application/json
{
  • "lastEvaluatedKey": "{\"offset\":100}",
  • "documents": [
    ]
}

Instances

Manage your Interactive Instances.

Get the most recent instances

Get the 100 most recent instances.

Authorizations:
OAuth2
query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

expand
Array of strings
Items Value: "sessions"

Specify if the associated instance sessions and/or version should also be returned.

orderBy
string
Enum: "createdAt" "createdAt desc" "createdAt asc" "modifiedAt" "modifiedAt desc" "modifiedAt asc" "instanceDescription" "instanceDescription desc" "instanceDescription asc" "status" "status desc" "status asc"

Specify on what field the result should be ordered (default order is descending).

lastEvaluatedKey
string

Used for pagination. Provide the returned lastEvaluatedKey of a previous listing to get the next 100 items. When the parameter is omitted, the first 100 items will be returned.

Responses

Response Schema: application/json
lastEvaluatedKey
required
string (The last evaluated key, can be provided on a following call as a request parameter to get the next set of items.)
required
Array of objects (The Instances Schema)

Response samples

Content type
application/json
{
  • "lastEvaluatedKey": "{\"offset\":100}",
  • "instances": [
    ]
}

Create new instance

Create new instance.

Authorizations:
OAuth2
Request Body schema: application/json

Instance creation data.

projectID
required
string (The project ID of the current Instance) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the current Instance) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
required
The document ID (string) or Array of The document ID (strings) (The document ID)
instanceDescription
required
string (The description for the instance)
data
required
object (The data used to cerate the instance)
expiration
number (Specifies an expiration period for the instance, as a number of hours from the instance creation date. All sessions of expired instances will be automatically closed and the expired instances will be deleted automatically. If omitted the instance will never expire.)

Responses

Response Schema: application/json
instanceID
required
string (The ID of the instance)

Request samples

Content type
application/json
{
  • "projectID": [
    ],
  • "environmentID": [
    ],
  • "documentID": [
    ],
  • "instanceDescription": [
    ],
  • "data": { },
  • "expiration": 0
}

Response samples

Content type
application/json
{
  • "instanceID": [
    ]
}

Get Interactive Instance info

Get Interactive Instance info

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

expand
Array of strings or null
Value: "documentName"

Specify if the associated info should also be returned.

Responses

Response Schema: application/json
instanceID
required
string (The ID of the instance)
instanceDescription
required
string (The Instance description)
createdAt
required
string <date-time> (When it was created)
modifiedAt
required
string <date-time> (When it was last modified)
status
required
string (The Status)
projectID
required
string (The project ID of the Interactive Documents) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the Interactive Documents.) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
contentHash
string (The hash of the content.)
Array of objects (The associated sessions. They are only returned when you provide the sessions expand parameter)
documentName
string (The Instance's Document name)
expiration
string or null <date-time> (Specifies an expiration period for the instance, as a timestamp string from the instance creation date. All sessions of expired instances will be automatically closed and the expired instances will be deleted automatically. If omitted the instance will expire after 1 year.)

Response samples

Content type
application/json
{
  • "instanceID": [
    ],
  • "instanceDescription": [
    ],
  • "createdAt": [
    ],
  • "modifiedAt": [
    ],
  • "status": [
    ],
  • "projectID": [
    ],
  • "environmentID": [
    ],
  • "contentHash": [
    ],
  • "sessions": [
    ],
  • "documentName": [
    ],
  • "expiration": [
    ]
}

Delete the provided Interactive Instance

Delete the provided Interactive Instance

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

Responses

Response Schema: application/json
status
required
string (The status, will always be the value 'deleted')

Response samples

Content type
application/json
{
  • "status": "string"
}

Get the 100 most recent instance versions that bel

Get the 100 most recent instance versions that belong to this instance.

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

lastEvaluatedKey
string

Used for pagination. Provide the returned lastEvaluatedKey of a previous listing to get the next 100 items. When the parameter is omitted, the first 100 items will be returned.

Responses

Response Schema: application/json
lastEvaluatedKey
required
string (The last evaluated key, can be provided on a following call as a request parameter to get the next set of items.)
required
Array of objects (The Instances Version Schema)

Response samples

Content type
application/json
{
  • "lastEvaluatedKey": "{\"offset\":100}",
  • "versions": [
    ]
}

Get the data of the specified instance version

Get the data of the specified instance version

path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

instanceVersionID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance version ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{ }

Get the current data of the instance

Get the current data of the instance

path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{ }

Update the current data of the instance. The authe

Update the current data of the instance. The authenticated user should have a open session to update the data.

path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{ }

Create a preview of the instance

Create a preview of the instance

path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

Request Body schema: application/json

Instance preview data.

projectID
required
string (The project ID of the current Instance) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the current Instance) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
outputType
required
string (The preview output type)
theme
string (The relative path of the theme used for preview)
instanceVersionID
string (The ID of the instance version associated with this session)

Responses

Response Schema: application/json
previewURL
required
string (The Instance Preview URL)

Request samples

Content type
application/json
{
  • "projectID": [
    ],
  • "environmentID": [
    ],
  • "outputType": [
    ],
  • "theme": [
    ],
  • "instanceVersionID": [
    ]
}

Response samples

Content type
application/json

Compare two versions of an instance

Compare two versions of an instance. The response contains ...

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

from
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance version ID to use as the base for the comparison

to
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance version ID to compare to

expand
required
Array of strings
Items Enum: "data" "interactive"

Specify if the dataPatch and/or interactivePatch needs be returned.

Responses

Response Schema: application/json
projectID
required
string (The project ID of the Interactive Documents) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the Interactive Documents.) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
instanceID
required
string (The instance ID of the Interactive Documents.) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
from
required
string (The base instance version ID to compare from.) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
to
required
string (The instance version ID to compare to.) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
Array of objects (The JSON patch (RFC 6902) for the data (excluding the interactive documents related data), when applied on the 'from' instance version it will result in the 'to' instance version)
Array of objects (The JSON patch (RFC 6902) for the interactive documents related data, when applied on the 'from' instance version it will result in the 'to' instance version)

Response samples

Content type
application/json
{
  • "projectID": "26cc1a35-3f15-443c-86ed-b73a09bccbb1",
  • "environmentID": "186fdf8a-0290-43a5-afbf-5d687648998e",
  • "from": "7181c66b-dcc0-42b9-a784-b847d3acc42e",
  • "to": "32c3f3b4-7a9e-4d5d-b91f-f0b0de940769",
  • "dataPatch": [
    ],
  • "interactivePatch": [
    ]
}

Sessions

Get the 100 most recent instance session.

Get the 100 most recent instance session.

Authorizations:
OAuth2
query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

lastEvaluatedKey
string

Used for pagination. Provide the returned lastEvaluatedKey of a previous listing to get the next 100 items. When the parameter is omitted, the first 100 items will be returned.

Responses

Response Schema: application/json
lastEvaluatedKey
required
string (The last evaluated key, can be provided on a following call as a request parameter to get the next set of items.)
required
Array of objects (The Instance Session Schema)

Response samples

Content type
application/json
{
  • "lastEvaluatedKey": "{\"offset\":100}",
  • "sessions": [
    ]
}

Delete instance sessions.

Delete instance sessions.

Authorizations:
OAuth2
query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

before
string(^[0-9]+$|^[0-9]{4}-[01][0-9]-[0-3][0-9](T[0-...

When provided only sessions who have a created date before this timestamp will be deleted.

The value should either be a number (milliseconds since 1 January 1970 UTC) or an ISO date (or dateTime) including a timezone.

Responses

Response Schema: application/json
deleteCount
required
integer (The number of sessions deleted)

Response samples

Content type
application/json
{
  • "deleteCount": 0
}

Get the 100 most recent instance session that belo

Get the 100 most recent instance session that belong to this session.

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

lastEvaluatedKey
string

Used for pagination. Provide the returned lastEvaluatedKey of a previous listing to get the next 100 items. When the parameter is omitted, the first 100 items will be returned.

Responses

Response Schema: application/json
lastEvaluatedKey
required
string (The last evaluated key, can be provided on a following call as a request parameter to get the next set of items.)
required
Array of objects (The Instance Session Schema)

Response samples

Content type
application/json
{
  • "lastEvaluatedKey": "{\"offset\":100}",
  • "sessions": [
    ]
}

Create a new instance session

Create a new instance session

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

Request Body schema: application/json

Instance session creation data.

projectID
required
string (The project ID of the current Instance Session) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the current Instance Session) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

Responses

Response Schema: application/json
sessionID
required
string (The ID of the session)
instanceVersionID
required
string (The ID of the instance version associated with this session)

Request samples

Content type
application/json
{
  • "projectID": [
    ],
  • "environmentID": [
    ]
}

Response samples

Content type
application/json
{
  • "sessionID": [
    ],
  • "instanceVersionID": [
    ]
}

Close instance session information

Close instance session information

Authorizations:
OAuth2
path Parameters
instanceID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The instance ID

sessionID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The session ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

description
required
string

The description of what was changed

Responses

Response Schema: application/json
status
required
string (The status, will always be the value 'closed')

Response samples

Content type
application/json
{
  • "status": "string"
}

reIndex

Re-index the interactive documents

Re-index the interactive documents

Authorizations:
OAuth2
Request Body schema: application/json

re-index configuration data.

projectID
required
string (The project ID of the current Instance Session) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
environmentID
required
string (The environment ID of the current Instance Session) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
templateURL
string (The path of the SDT to re-index. If omitted all templates in the project/environment will be re-indexed.)

Responses

Request samples

Content type
application/json
{
  • "projectID": [
    ],
  • "environmentID": [
    ],
  • "templateURL": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "reIndexID": "string"
}

Get information about the re-index operation.

Get information about the re-index operation.

Authorizations:
OAuth2
path Parameters
reIndexID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The re-index ID

query Parameters
projectID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The project ID of the Interactive Documents

environmentID
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...

The environment ID of the instances.

Responses

Response Schema: application/json
status
required
string (The status)
Enum: "indexing" "failed" "completed"
createdAt
required
string <date-time> (When it was created)
modifiedAt
required
string <date-time> (When it was last modified)
Array of objects (information of the indexed documents)

Response samples

Content type
application/json
{
  • "status": "indexing",
  • "createdAt": [
    ],
  • "modifiedAt": [
    ],
  • "documents": [
    ]
}

Authentication

Endpoint which implements the OAuth Assisted Token flow.

Endpoint which implements the OAuth Assisted Token flow

query Parameters
client_id
required
string

The client_id to use (redirect URLs should contain the URL of the page that uses assisted flow and should have permission oauth:token-service:assisted-token-grant)

for_origin
required
string

The origin of the page that uses the assisted flow

prompt
string
Value: "none"

If prompt none is provided no user interaction will be allowed to complete the login action.

scope
string

The scope parameter allows you to specify what access is needed.

Responses

Response samples

Content type
application/json
{ }

Login callback hook.

Login callback hook.

query Parameters
code
string

The authorization code generated by the authorization server.

state
string

The exact value received from the client when initiating the authorization flow.

session_state
string

The OpenID session state.

error
string

The error code if an error ocurred.

Responses

Response samples

Content type
application/json
{ }