Triggers API

Write Call

RecordCustomTrigger1

Records occurrence of a custom event or condition, mapped to a custom trigger set up in Bubblehouse.

Kind Write API call
Method POST
URL https://app.bubblehouse.com/api/v2023061/<shop>/RecordCustomTrigger1
Authentication AnonymousCustomer TokenShop Token

This call has flexible authentication requirements, depending on the configuration set up by Bubblehouse. The most typical usage is making this call from your server using a shop token and specifying a customer ID.

After this call returns, its expected effect — i.e. awarding of points, unlocking of achievements, and other actions — might take a few seconds to be processed (or, in rare cases, longer).

The trigger information is checked for validity at the time of the call, and thus invalid trigger data will always be reported. Customer information might not be fully validated until later, however, and thus invalid customer data might not be reported directly.

A successful API request can be rejected by the trigger's configured reward limit or because the trigger is disabled. In that case ok remains true, accepted is false, and rejection_msg explains the customer-facing outcome.

Input

  • customer CustomerIdentity1 required if using a shop token

    A customer to operate upon, when using a shop token or no authentication.

    If you're using a customer token and decide to pass this field (which we do not recommend), it must match the customer from the token.

  • trigger string required

    Specifies the custom trigger; must match a slug of one of the triggers defined in Bubblehouse admin area.

Output

  • ok always true required

    Indicates a successful response.

  • accepted boolean required

    Whether the trigger occurrence was accepted for reward processing.

  • rejection_msg string optional

    Customer-facing explanation when the occurrence was not accepted.

Specific Errors

Status Error Reason & Examples
400 unknown_trigger

Global Errors

Status Error Reason & Examples
401 invalid_token

The provided authentication token is invalid or has expired.

Previous
Overview