You are viewing the Resources for the older version of JourneyApps (V3). JourneyApps V4 is the new default for all new apps since July 1, 2016.

Getting an App's Data Model

It is sometimes necessary to know what the structure is of the data that will be returned by the JourneyApps API. For example, knowing which attributes to expect for certain objects, and what the option labels for enums are.

This API function allows you to retrieve a structured representation of your app's Data Model, exactly as defined in the JourneyApps Editor.

Relative URL HTTP Request Method
/api/v1/_datamodel.format GET

Parameters

This API function does not take any parameters (except for standard ETag functionality — please see below)

Response

The response will contain a list of the object types in the particular app's Data Model, with a list of attributes of each object type. Relationships of the object types is also included.

Note: The Data Model is a representation of the fields defined by the developer of the app in the app's Data Model. The JourneyApps API will also return some metadata in addition to these fields. For example _updated_at and id will be returned in JourneyApps API responses (see Retrieving All Objects: Response).

The HTTP headers for the response also include an ETag header which allows you to keep track of versions of the Data Model. Whenever changes are made to the app's Data Model, the hash in the ETag header will change. You can include this ETag hash value with the If-None-Match header in subsequent calls to the _datamodel API function. If the Data Model for the app hasn't changed, a "304 Not Modified" response code will be returned.

Example

Previous Section