Skip to content

Forms and events ​

Fetch form definitions and events, submit answers, and register event leads. Forms can return grading counts when questions have answer keys.

Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.

Create event lead ​

MethodURL pathRequired access
POST/api/v1/user/event/lead/:event_idOrigin + Brand key + Customer
POST/api/v1/brand/event/lead/:event_idOrigin + Brand key

Request fields:

FieldTypeRequiredRules / meaning
path.event_idnumberyes—
body.payloadobjectoptionalAt least one of ("email" , "phone_number"); Paired fields ("phone_number" , "phone_prefix")
body.payload.first_namestringoptional—
body.payload.last_namestringoptional—
body.payload.emailstringoptionalEmail address
body.payload.phone_prefixstringoptional—
body.payload.phone_numberstringoptional—
body.payload.sourcestringoptional—
body.payload.push_tokenstringoptional—
body.payload.form_responsesarray of objectoptionalDefault ([ ])
body.payload.form_responses[].question_idnumberyes—
body.payload.form_responses[].answerany JSON valueyes—

Example (first URL):

bash
curl -X POST "$BASE_URL/api/v1/user/event/lead/1" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"email":"alex@example.com"}}'

Response: {"success":true,"message":"..."} from the event-lead service.

Source: app/v1/controller/event_controller.ts:12 → createEventLead; routes: routes/v1/event_route.ts:66; service: _createEventLead (app/v1/service/event_service.ts:14).

Get event by ID ​

MethodURL pathRequired access
GET/api/v1/brand/event/:event_idOrigin + Brand key

Request fields:

FieldTypeRequiredRules / meaning
path.event_idnumberyes—

Example:

bash
curl -X GET "$BASE_URL/api/v1/brand/event/1" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/event_controller.ts:77 → getEventById; routes: routes/v1/event_route.ts:75; service: _getEventById (app/v1/service/event_service.ts:177).

Get all events ​

MethodURL pathRequired access
GET/api/v1/brand/eventsOrigin + Brand key
GET/api/v1/user/eventsOrigin + Brand key + Customer

Request fields:

FieldTypeRequiredRules / meaning
query.tagsarray of stringoptional—
query.limitnumberoptional—
query.offsetnumberoptional—
query.searchstringoptionalWhitespace trimmed
query.group_byarray of stringoptional—
query.includeExpiredbooleanoptionalDefault (false)
query.expiredOnlybooleanoptional—
query.typestringoptionalAllowed values ("standard", "drop")
query.sortItemstringoptionalNo controller schema
query.sortTypestringoptionalNo controller schema

tags and group_by are comma-separated query strings. sortItem and sortType are comma-separated lists of equal length. includeExpired and expiredOnly are compared with the string true.

Example (first URL):

bash
curl -X GET "$BASE_URL/api/v1/brand/events?limit=10&offset=0" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/event_controller.ts:110 → getAllEvents; routes: routes/v1/event_route.ts:94; service: _getAllEvents (app/v1/service/event_service.ts:227).

Create form response ​

MethodURL pathRequired access
POST/api/v1/brand/form/responseOrigin + Brand key + Customer
POST/api/v1/brand/public/form/responseOrigin + Brand key

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.form_assignment_idnumberyes—
body.payload.form_responsearray of objectyes—
body.payload.form_response[].question_idnumberyes—
body.payload.form_response[].answerstringyesWhitespace trimmed

Example (first URL):

bash
curl -X POST "$BASE_URL/api/v1/brand/form/response" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"form_assignment_id":1,"form_response":[{"question_id":1,"answer":"example"}]}}'

Response: JSON with success: true and result containing the operation’s service data. Result fields/details: message, id, correct_answer_count, total_questions.

Source: app/v1/controller/form_controller.ts:8 → createFormResponse; routes: routes/v1/form_route.ts:50; service: _createFormResponse (app/v1/service/form_service.ts:4).

Get form by type ​

MethodURL pathRequired access
GET/api/v1/brand/form/typeOrigin + Brand key

Request fields:

FieldTypeRequiredRules / meaning
query.idnumberyes—
query.typestringyesWhitespace trimmed; Allowed values ("scan_verify", "scan_survey", "product_review", "form_survey")

Example:

bash
curl -X GET "$BASE_URL/api/v1/brand/form/type?id=1&type=scan_verify" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/form_controller.ts:55 → getFormByType; routes: routes/v1/form_route.ts:60; service: _getFormByType (app/v1/service/form_service.ts:111).

Batch platform, Shopify app and API documentation