Skip to main content

Documentation Index

Fetch the complete documentation index at: https://api.docs.onlydrams.app/llms.txt

Use this file to discover all available pages before exploring further.

Parameters

event_type
string
required
The type of event being recorded. Must be one of the allowed event types:
  • custom_bottle_form_opened
  • custom_bottle_form_abandoned
  • custom_bottle_search_before_create
  • custom_bottle_selected_after_results
  • custom_bottle_upc_different_selected
data
object
Event-specific data payload. See examples below for each event type.

Returns

Returns 200 OK with no body if the event was recorded successfully, otherwise returns an error message.

Event Types

Form Opened

Record when user opens the custom bottle creation form.
  curl -X POST https://api.onlydrams.app/api/v1/events \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $ACCESS_TOKEN" \
       -d '{
            "event_type": "custom_bottle_form_opened",
            "data": {
              "search_query": "buffalo trace",
              "search_results_count": 5,
              "upc_scanned": true,
              "upc_results_count": 0
            }
          }'
data.search_query
string
The search term used before opening the form (if any).
data.search_results_count
integer
Number of search results shown before user chose to create custom.
data.upc_scanned
boolean
Whether user scanned a UPC before opening the form.
data.upc_results_count
integer
Number of UPC matches found (if scanned).

Form Abandoned

Record when user closes the form without creating a bottle.
  curl -X POST https://api.onlydrams.app/api/v1/events \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $ACCESS_TOKEN" \
       -d '{
            "event_type": "custom_bottle_form_abandoned",
            "data": {
              "fields_filled": ["name", "distillery", "proof"],
              "time_spent_seconds": 45,
              "last_field_edited": "proof"
            }
          }'
data.fields_filled
array
List of field names that were filled. Empty array if form was abandoned without filling anything.
data.time_spent_seconds
integer
Time spent on the form before abandoning.
data.last_field_edited
string
The last field the user interacted with.

Search Before Create

Record when user performs a search, sees results, but chooses to create a custom bottle anyway.
  curl -X POST https://api.onlydrams.app/api/v1/events \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $ACCESS_TOKEN" \
       -d '{
            "event_type": "custom_bottle_search_before_create",
            "data": {
              "search_query": "pappy van winkle 15",
              "results_count": 3,
              "top_result_name": "Pappy Van Winkle 15 Year"
            }
          }'
data.search_query
string
The search term used.
data.results_count
integer
Number of results returned.
data.top_result_name
string
Name of the first result shown.

Selected After Results

Record when user searches, gets results, but selects “Add Custom Bottle” instead of an existing result.
  curl -X POST https://api.onlydrams.app/api/v1/events \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $ACCESS_TOKEN" \
       -d '{
            "event_type": "custom_bottle_selected_after_results",
            "data": {
              "search_query": "store pick bourbon",
              "results_count": 12,
              "results_viewed": 3
            }
          }'
data.search_query
string
The search term used.
data.results_count
integer
Total results available.
data.results_viewed
integer
How many results the user scrolled through.

UPC Different Bottle Selected

Record when user scans a UPC, gets matches, but selects “Different Bottle” to create a custom bottle.
  curl -X POST https://api.onlydrams.app/api/v1/events \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $ACCESS_TOKEN" \
       -d '{
            "event_type": "custom_bottle_upc_different_selected",
            "data": {
              "upc": "123456789012",
              "matches_count": 2,
              "match_names": ["Buffalo Trace", "Buffalo Trace Single Barrel"]
            }
          }'
data.upc
string
The scanned UPC code.
data.matches_count
integer
Number of bottles matched to this UPC.
data.match_names
array
Names of the matched bottles.

UPC Scan Tracking

The existing scan endpoint now tracks the input method. Add input_method parameter to distinguish camera scans from manual entry.

Parameters

upc
string
required
The UPC code to scan.
input_method
string
required
How the UPC was entered. Either camera or manual.
  curl -X GET "https://api.onlydrams.app/api/v1/scan?upc=123456789012&input_method=camera" \
       -H "Authorization: Bearer $ACCESS_TOKEN"
{
  "total": 1,
  "has_more": false,
  "data": [
    {
      "id": "8adc7c69-4d33-488c-b73c-e03ac91d6472",
      "name": "Buffalo Trace",
      "distillery": "Buffalo Trace Distillery"
    }
  ]
}

Automatic Server-Side Tracking

The following data is automatically added to all events by the server:
FieldDescription
subscription_tierUser’s current tier (elite, premium, free, nil)
is_eliteBoolean
is_premiumBoolean
platformDetected from User-Agent (ios, android, other)
user_idFrom authentication token
request_idFor debugging/tracing