Push Events

Table of contents

Introduction

The Looklet system can be configured to send “push events” to notify an external system when certain events occur concerning an item or an image.

HTTP Endpoint Basics

The Looklet push events are sent to a base URL defined by the customer. Each event has a dedicated sub path that is appended to the end of the base URL. An example:

  • Base URL: https://example.com/integration/looklet
  • URL Sub Path: /item-created
  • Final URL: https://example.com/integration/looklet/item-created

The following information applies for all push events:

  • URL: Base URL + URL Sub Path
  • Method: POST
  • Encoding: application/json (charset=UTF-8)
  • Body: The JSON content of the message
  • Query Parameters:
PARAMETER DETAILS
id UUID. Unique message id.
version Number. API request version number.
deprecated Boolean. Indicates whether this API request is deprecated or not.
timestamp Unix timestamp. Example: 1456996672.

Legacy Messages

For legacy reasons it is possible to configure the Looklet system to send the messages as application/x-www-form-urlencoded with all query parameters as form data in the message body.
In this case the JSON content will be included as a form field named content.

Authentication

Two types of authentication are supported:

  • Basic auth (username and password)
  • API key header

Basic Auth

Basic auth is also known as username and password auth.

We need the following information

  1. The username, e.g., “Looklet”
  2. The password, e.g., “ZZGFZBH8YTLG76EYK41H”

API Key Header Auth

API key header auth works by sending a custom HTTP header containing an API key.

We need the following information

  1. The header name, e.g., “X-API-KEY” or “api_key”
  2. The header value, e.g., “ZZGFZBH8YTLG76EYK41H”

Item Created Event

Description: An item has been created
URL Sub Path: /item-created

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },  
    "studio": "Studio 1",
    "createdBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "designer": "DesignerName",
    "category": "Dress",
    "batches": [
        "example-batch1",
        "example-batch2"
    ],
    "colorLabel": "GREEN",
    "views": [
        {
            "id": 2323,
            "pose": "Ella",
            "angle": "Front",
            "url": "https://url.to.image",
            "variantId": "4567",
            "hasComplement": "true"
        },
        {
            "id": 2324,
            "pose": "Ella",
            "angle": "Back",
            "url": "https://url.to.image",
            "variantId": "4568",
            "hasComplement": "false"
        }
    ],
    "displays": [
        {
            "id": 1001,
            "url": "https://url.to.image",
            "type": "display type"
        },
        {
            "id": 1002,
            "url": "https://url.to.image",
            "type": "display type"
        }
    ],
    "comments": [
        {
            "createdBy": {
                "name": "John Doe",
                "email": "john@doe.com"
            },
            "timestamp": 1456996672,
            "comment": "Comment text"
        }
    ]
}

Item Updated Event

Description: An item has been updated
URL Sub Path: /item-updated

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "studio": "Studio 1",
    "createdBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "designer": "DesignerName",
    "category": "Dress",
    "batches": [
        "example-batch1",
        "example-batch2"
    ],
    "colorLabel": "GREEN",
    "views": [
        {
            "id": 2323,
            "pose": "Ella",
            "angle": "Front",
            "url": "https://url.to.image",
            "variantId": "4567",
            "hasComplement": "true"
        },
        {
            "id": 2324,
            "pose": "Ella",
            "angle": "Back",
            "url": "https://url.to.image",
            "variantId": "4568",
            "hasComplement": "false"
        }
    ],
    "displays": [
        {
            "id": 1001,
            "url": "https://url.to.image",
            "type": "display type"
        },
        {
            "id": 1002,
            "url": "https://url.to.image",
            "type": "display type"
        }
    ],
    "comments": [
        {
            "createdBy": {
                "name": "John Doe",
                "email": "john@doe.com"
            },
            "timestamp": 1456996672,
            "comment": "Comment text"
        }
    ]
}

Item Approved Event

Description: An item has been approved and is ready for styling in Look Creator
URL Sub Path: /item-approved

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "approvedBy": {
        "name": "Looklet",
        "email": "no-reply@looklet.com"
    },
    "views": [
        {
            "id": 2323,
            "pose": "Ella",
            "angle": "Front",
            "url": "https://url.to.image",
            "variantId": "4567",
            "hasComplement": "true"
        },
        {
            "id": 2324,
            "pose": "Ella",
            "angle": "Back",
            "url": "https://url.to.image",
            "variantId": "4568",
            "hasComplement": "false"
        }
    ],
    "displays": [
        {
            "id": 1001,
            "url": "https://url.to.image",
            "type": "display type"
        },
        {
            "id": 1002,
            "url": "https://url.to.image",
            "type": "display type"
        }
    ]
}

Look Exported Event

Description: A look has been exported
URL Sub Path: /look-exported

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "exportedBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "model": {
        "id": 20,
        "variantId": 215
    },
    "scene": {
        "id": 5,
        "variantId": 102
    },
    "items": [
        {
            "id": 123,
            "variantId": 2312,
            "externalId": "external-id-1"
        },
        {
            "id": 124,
            "variantId": 23122,
            "externalId": "external-id-2"
        },
        {
            "id": 122,
            "variantId": 23121,
            "externalId": "external-id-3"
        }
    ],
    "looks": [
        {
            "pose": "Ella",
            "angle": "Front",
            "name": "1_ABCD-123_FRONT",
            "url": "https://url.to.image"
        }
    ]
}

Display Exported Event

Description: A display image has been exported
URL Sub Path: /display-exported

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "exportedBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "display": {
        "id": 10001,
        "url": "https://url.to.image",
        "name": "display image name"
    }
}

Looks Assigned to Group Event

Description: An item has been assigned to a Group 1
URL Sub Path: /looks-assigned-to-group

This event will contain the item along with the id of the Group that the item was assigned to as well as the id of the Group the item was assigned from.

Note: This can be used detect when an item was sent to QC - The Group would change from null to QCID 2. It can also be used to detect when the item is returned from QC - The Group would change from QCID 2 to null.

  1. A Group of accounts. Tip: This is most probably the Quality Control Group 2
  2. QCID: Ask your Looklet representative what your Quality Control Group ID is.

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "looksAssignedFromGroup": null,
    "looksAssignedToGroup": 35
}

Rejected Quality Control Event

Description: An item has been rejected to quality control
URL Sub Path: /rejected-quality-control

This event will only contain the views or displays that have been rejected for quality control as a consequence of the event action.

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "rejectedBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "views": [
        {
            "id": 2323,
            "pose": "Ella",
            "angle": "Front",
            "url": "https://url.to.image",
            "variantId": "4567",
            "hasComplement": "true"
        },
        {
            "id": 2324,
            "pose": "Ella",
            "angle": "Back",
            "url": "https://url.to.image",
            "variantId": "4568",
            "hasComplement": "false"
        }
    ],
    "displays": [
        {
            "id": 1001,
            "url": "https://url.to.image",
            "type": "display type"
        },
        {
            "id": 1002,
            "url": "https://url.to.image",
            "type": "display type"
        }
    ]
}

Item Rejected Reshoot Event

Description: An item has been rejected for reshoot
URL Sub Path: /item-rejected-reshoot

This event will only contain the views or displays that have been rejected for reshoot as a consequence of the event action.

Example JSON content:

{
    "externalId": "ABCD-1234",
    "itemId": 321632,
    "properties": {
      "CustomDate1": "2018-01-20",
      "CustomDate2": "2020-12-31",
      "CustomNumber1": "105",
      "CustomNumber2": "3.14",
      "CustomBoolean1": "True",
      "CustomBoolean2": "False",
      "CustomString1": "Custom String Here",
      "CustomString2": ""
    },
    "rejectedBy": {
        "name": "John Doe",
        "email": "john@doe.com"
    },
    "views": [
        {
            "id": 2323,
            "pose": "Ella",
            "angle": "Front",
            "url": "https://url.to.image",
            "variantId": "4567",
            "hasComplement": "true"
        },
        {
            "id": 2324,
            "pose": "Ella",
            "angle": "Back",
            "url": "https://url.to.image",
            "variantId": "4568",
            "hasComplement": "false"
        }
    ],
    "displays": [
        {
            "id": 1001,
            "url": "https://url.to.image",
            "type": "display type"
        },
        {
            "id": 1002,
            "url": "https://url.to.image",
            "type": "display type"
        }
    ]
}