Introduction

This document provides details of the Profile API. It is recommended that you read both the Data API Introduction page and the Ometria Data Architecture pages before integrating with Ometria.

Profile Methods

Fetch list of profiles

Fetch individual profile

Profile Objects

Profile

Profile Dates object

Profile Identities object

Profile Lists object

Profile Stats object



Fetch list of profiles

Path

GET /profiles/

Description

Return profiles as a JSON array

Request Parameters

limitNumber of records to fetch. Max 250.
typeinteger (default: "10")
inquery
offsetIndex of first record to fetch
typeinteger
inquery
updateSinceOnly return profiles which have been updated since this date
typestring (date)
inquery

Response

200 OK
Profile 

List of profile objects


403 ForbiddenAPI key is not authorised to access this resource
404 Not FoundList with specified ID was not found

Response Example (200 OK)

[
  {
    "@type": "profile",
    "country": null,
    "customer_id": "55555",
    "date_of_birth": "1984-04-22",
    "dates": {
      "acquired": "2014-11-01T15:34:35+00:00",
      "first_purchase": "2015-02-01T05:44:55+00:00",
      "first_seen": "2014-12-01T05:44:55+00:00",
      "last_purchase": "2015-02-01T05:44:55+00:00",
      "last_seen": "2015-02-01T05:44:55+00:00"
    },
    "email": "bob22@example.com",
    "firstname": null,
    "gender": "m",
    "id": "2695-c473e2-4aaf58",
    "identities": [
      {
        "id": "bob22@example.com",
        "type": "email"
      }
    ],
    "lastname": "smith111",
    "marketing_optin": null,
    "middlename": null,
    "name": "smith111",
    "prefix": null,
    "properties": {
      "custom_key": "custom value"
    },
    "seen": false,
    "stats": {
      "aov": 99.17,
      "orders": 1,
      "orders_attempted": 1,
      "revenue": 99.17,
      "total_items": 5,
      "visits": 20
    },
    "suffix": null,
    "tags": [
      "Attended VIP event 2017"
    ]
  }
]



Fetch individual profile

Path

GET /profiles/{profile_id}

Description

Return profile as a JSON object

Request Parameters

profile_idID of the profile to fetch.
typestring
inpath

Response

200 OK
Profile 

Return a single profile record

403 Forbidden

API key is not authorised to access this resource

404 Not Found

Profile with specified ID was not found

Response Example (200 OK)

{
  "@type": "profile",
  "country": null,
  "customer_id": "55555",
  "date_of_birth": "1984-04-22",
  "dates": {
    "acquired": "2014-11-01T15:34:35+00:00",
    "first_purchase": "2015-02-01T05:44:55+00:00",
    "first_seen": "2014-12-01T05:44:55+00:00",
    "last_purchase": "2015-02-01T05:44:55+00:00",
    "last_seen": "2015-02-01T05:44:55+00:00"
  },
  "email": "bob22@example.com",
  "firstname": null,
  "gender": "m",
  "id": "2695-c473e2-4aaf58",
  "identities": [
    {
      "id": "bob22@example.com",
      "type": "email"
    }
  ],
  "lastname": "smith111",
  "marketing_optin": null,
  "middlename": null,
  "name": "smith111",
  "prefix": null,
  "properties": {
    "custom_key": "custom value"
  },
  "seen": false,
  "stats": {
    "aov": 99.17,
    "orders": 1,
    "orders_attempted": 1,
    "revenue": 99.17,
    "total_items": 5,
    "visits": 20
  },
  "suffix": null,
  "tags": [
    "Attended VIP event 2017"
  ]
}

ProfileDates: object

Contains date / time information of a profile

ValueTypeDescription
first_seenstring (date-time)The date time when this contact was first seen.
last_seenstring (date-time)The date time when this contact was last seen.
first_purchasestring (date-time)The date time when this contact first placed an order.
last_purchasestring (date-time)The date time when this contact last placed an order.
acquiredstring (date-time)The date time when this contact was acquired.
marketing_optinstring (date-time)The date time when this contact opted in to receive marketing emails.
marketing_optoutstring (date-time)The date time when this contact opted out to no longer receive marketing emails.

Example

{
  "acquired": "2014-11-07T15:34:35+00:00",
  "first_purchase": "2015-02-01T05:44:55+00:00",
  "first_seen": "2014-12-01T05:44:55+00:00",
  "last_purchase": "2015-02-01T05:44:55+00:00",
  "last_seen": "2015-02-01T05:44:55+00:00",
  "marketing_optin": "2014-11-09T15:34:35+00:00",
  "marketing_optout": null
}

ProfileIdentities: object

Contains identity information used to construct the profile

ValueTypeDescription
idstringThe ID of the profile
typestringThe type of ID

Example

[
  {
    "id": "bob22@example.com",
    "type": "email"
  }
]

ProfileLists: object

Contains the saved segments (lists) that a profile belongs to.

ValueTypeDescription
idstringThe ID of the list
titlestringThe title of the list
type{ STATIC , DYNAMIC }The type of list

Example

[
  {
    "id": 123,
    "title": "Title of the list",
    "type": "STATIC"
  }
]

ProfileStats: object

Contains numeric stats of a profile.
ValueTypeDescription
ordersnumberNumber of valid orders this profile has placed.
orders_attemptednumberNumber of orders attempted by this contact profile (this includes valid as well as invalid orders).
total_itemsnumberNumber of items purchased.
aovnumber (float)Average order value of this contact profile.
revenuenumber (float)Total revenue for this contact profile.
visitsnumberTotal number of visits for this contact profile.


Example

{
  "aov": 49.72,
  "orders": 2,
  "orders_attempted": 3,
  "revenue": 99.44,
  "total_items": 5,
  "visits": 20
}