Skip to content

Souvenir collection

This case study explains how you can incentivise your visitors to perform certain actions at an experience by gifting souvenirs.

We will use the moment, souvenir and catalogue resources.

Example scenario

Suppose we have a requirement that all visitors must:

  • Register online before attending an event
  • Check in at reception when they arrive

Once they have performed these two actions they will be issued a digital attendance badge.

To automate this process in XPKit you could do the following:

Setup resources

To get started you would create two objects (this can be done in XPKit Portal):

{
    "description": "Registration website for event",
    "name": "Registration website",
    "object_id": "registration-website"
}
{
    "description": "Tablet on reception table at event",
    "name": "Reception tablet",
    "object_id": "reception-tablet"
}

Whenever a visitor registers, your website would make a request to XPKit to create a profile...

{
    "first_name": "Example",
    "last_name": "Person",
    "email": ["example.person@test.com"]
}

...and a registration activity (using the registration-website Object ID created above).

{
    "experience_id": "example-event",
    "activity_type": "registration",
    "payload": {
        "object_id": "registration-website"
    },
    "owner_id": "63f1cd1a-77f3-4175-9826-c67c54ed51d8"
}

Finally the tablet app would create a check in activity once the visitor has checked in on arrival:

{
    "experience_id": "example-event",
    "activity_type": "check-in",
    "payload": {
        "object_id": "reception-tablet"
    },
    "owner_id": "63f1cd1a-77f3-4175-9826-c67c54ed51d8"
}

Note: you can assume the ID of the saved profile is: 63f1cd1a-77f3-4175-9826-c67c54ed51d8.

Working with moments

Simply put a moment is a collection of activities.

Technically they can be defined as a grouping of object_ids. If a visitor (profile) has activities generated by all the required objects (activity.payload.object_id) they have experienced that moment for an experience.

Back to the example, we can create a moment to encapsulate our requirements (this can be created in XPKit Portal):

{
    "name": "Registered and checked in",
    "experience_id": "example-event",
    "object_ids": [
        "registration-website",
        "reception-tablet"
    ]
}

You can assume the ID of the saved moment is: ac15708e-5185-4602-a918-f48f9dee2f6e.

Incentivising using souvenirs

A souvenir is a generic digital asset that can be gifted to visitors. Souvenirs can be documents, images or videos. Qualification for a souvenir depends on a visitor having experienced moments.

For our example we will create a souvenir that should be available to visitors who have experienced the moment we just created.

{
    "name": "Attendance badge",
    "url": "https://souvenirs.s3.amazonaws.com/registration_complete_badge.png",
    "type": "image",
    "experience_id": "example-event",
    "moment_ids": [
        "ac15708e-5185-4602-a918-f48f9dee2f6e"
    ]
}

Retrieval using the catalogue

Finally we need some way for visitors to access their souvenirs. This is where the catalogue service comes in. Given profile lookup information and an experience the catalogue will return all souvenirs that visitor has earned. Here is how you would use it:

Request

{
    "experience_id": "example-event",
    "profile_key_and_value": {
        "email": "example.person@test.com"
    },
    "account_id": "<your xpkit account ID>"
}

Response

{
    "resource_url": "/api/catalogue",
    "resource_id": "CATALOGUE",
    "resource": {
        "results": [
            {
                "experience_id": "example-event",
                "moment_ids": [
                    "ac15708e-5185-4602-a918-f48f9dee2f6e"
                ],
                "name": "Attendance badge",
                "type": "image",
                "url": "https://souvenirs.s3.amazonaws.com/registration_complete_badge.png",
                "souvenir_data": [
                    {
                        "url": "https://ugc.s3.amazonaws.com/example_person_profile_image.png"
                    }
                ],
                "created": "2022-03-01T14:56:32Z",
                "last_modified": "2022-04-05T03:12:56Z"
            }
        ]
    }
}

Note: you may be wondering what the souvenir_data array is. If any of the required activities to qualify for a moment are created via the vcc service, they will contain a payload.souvenir_data key. This key stores information about personalised created content (videos, images etc.) uploaded to a destination. It is included here so the catalogue returns both generic and personalised souvenirs in the same response.

Demo

The souvenir collection site demo uses the catalogue service. To see it in action visit the: