Trax Platform APIv1

Household and participant forms

Each organization designs its own forms in Trax. The API serves them to signed-in families:

Activity forms are answered in the checkout forms step (cart and checkout guide); this guide covers reading them and the signature element they can share with the participant form.

The server picks the form. You never send a form id. The API serves the form the organization set up for this portal. Each save is checked on the server and writes only the fields you send. A portal without a household form answers 404 form-not-configured, and its households don't need to verify before registering.

The form

The household form

GET https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household → 200 OK, JSON

curl
curl -s 'https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household' \
  -H 'Authorization: Bearer your_access_token'
JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household', {
  headers: {
    'Authorization': 'Bearer your_access_token',
  },
});
const data = await response.json();
C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household");
request.Headers.Authorization = new("Bearer", "your_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();

GET …/forms/household and GET …/forms/participant return the form as staff designed it:

Part Meaning
formId, title The form
definitionHash Changes whenever staff edit the form. Send it back with a save to catch edits made in between
rows[].columns[] The layout: each column has a width and either an element or more rows

Each element is a field, a collection or a static element.

Fields have a key:

Collections (type: "collection") hold repeated entries: addresses, phones, emails, school records, contacts, household members, household contacts, and custom data records:

Static elements have no key: header (text), editor (staff html, already sanitized), horizontal-divider, blank and pagebreak (a print hint; forms are one page).

Signatures (type: "signature") appear only where the organization uses electronic signatures; elsewhere they are left out and never required, as in the current portal. Each has:

Elements the API doesn't serve (military, work history, education history, references and staff-only fields) are left out. A form that needs one of them answers 409 form-not-renderable.

What the keys hold

Keys What they hold
person.*, participant.* The member: name, birth date, gender, ethnicity, race, SSN, languages, disabilities, medical fields, sizes, education, the pickup password and program flags
person.identification.{id} One of the organization's identification fields (a student ID, for example)
person.addresses, person.phoneNumbers, person.emailAddresses The member's addresses, phones and emails
participant.schoolRecord School records at this organization (each needs its school)
participant.contacts Contacts: people with emergency, pickup and must-not-pick-up flags, one primary emergency contact. New entries become new people
household.* The household and its head: household details, the head's name, flags, addresses, phones and emails
household.contacts The other household members (edited only)
household.hhContacts Contacts who aren't members. New entries become new people; removing one removes the link
dynamic.{dataSetId} Records of one of the organization's custom data sets; entry fields are named after its attributes

An activity's form

An activity's form

GET https://api.nfocus.solutions/v1/portals/riverbend/north/activities/7/form → 200 OK, JSON

curl
curl -s 'https://api.nfocus.solutions/v1/portals/riverbend/north/activities/7/form' \
  -H 'Authorization: Bearer your_access_token'
JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/portals/riverbend/north/activities/7/form', {
  headers: {
    'Authorization': 'Bearer your_access_token',
  },
});
const data = await response.json();
C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/portals/riverbend/north/activities/7/form");
request.Headers.Authorization = new("Bearer", "your_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();

GET …/activities/{activityId}/form returns the activity's form when it has one, or 404 form-not-configured. Its fields are participant-form fields (person.*, participant.*, dynamic.*). Families answer them for each member registering, in the checkout forms step (see "Forms and waivers" in the cart and checkout guide).

Answers

The household's answers

GET https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers → 200 OK, JSON

curl
curl -s 'https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers' \
  -H 'Authorization: Bearer your_access_token'
JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers', {
  headers: {
    'Authorization': 'Bearer your_access_token',
  },
});
const data = await response.json();
C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers");
request.Headers.Authorization = new("Bearer", "your_access_token");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();

GET …/forms/household/answers and GET …/forms/participant/people/{personId} return what is stored. Only the fields on the form are returned, keyed by field key:

Kind Value
Text, list choices A string. List values are the options' value
Numbers A number
Dates YYYY-MM-DD
Dates with times, times YYYY-MM-DDTHH:MM, HH:MM
Check boxes true or false
Several choices A list of option values
Phones { "number", "extension", "formatted" }
Collections A list of entries, each with id, isPrimary and its fields
SSN *****1234, never the full number

The participant form is for a member of the signed-in family's household; anyone else answers 404 member-not-found.

Saving

PUT the same path with the answers:

{
  "definitionHash": "…",
  "answers": {
    "household.familySize": 4,
    "household.addresses": [{ "id": 120, "address1": "22 Synthetic Lane", "isPrimary": true }],
    "household.phoneNumbers": [{ "id": 98 }, { "phoneType": "3", "phone": { "number": "555-201-0099" } }]
  }
}

What a save changes:

Signatures

Draw signatures with Signature Pad 4.x and send, for each one signed:

"signatures": [
  { "signatureId": "00000000-0000-4000-8000-000000000508", "printedName": "Pat Example", "strokes": [ … ] }
]

A participant-form save naming a signature the form doesn't have

PUT https://api.nfocus.solutions/v1/portals/riverbend/north/forms/participant/people/1234 → 400, problem details

curl
curl -s -X PUT 'https://api.nfocus.solutions/v1/portals/riverbend/north/forms/participant/people/1234' \
  -H 'Authorization: Bearer your_access_token' \
  -H 'Content-Type: application/json' \
  -d '{"answers": {}, "signatures": [{"signatureId": "not-on-this-form", "printedName": "Pat Example", "strokes": []}]}'
JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/portals/riverbend/north/forms/participant/people/1234', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer your_access_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"answers": {}, "signatures": [{"signatureId": "not-on-this-form", "printedName": "Pat Example", "strokes": []}]}),
});
const data = await response.json();
C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Put, "https://api.nfocus.solutions/v1/portals/riverbend/north/forms/participant/people/1234");
request.Headers.Authorization = new("Bearer", "your_access_token");
request.Content = new StringContent("""
    {"answers": {}, "signatures": [{"signatureId": "not-on-this-form", "printedName": "Pat Example", "strokes": []}]}
    """, System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();

A save with answers the form refuses

PUT https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers → 422, problem details

curl
curl -s -X PUT 'https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers' \
  -H 'Authorization: Bearer your_access_token' \
  -H 'Content-Type: application/json' \
  -d '{"answers": {"household.familySize": 0, "household.firstname": ""}}'
JavaScript
const response = await fetch('https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer your_access_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"answers": {"household.familySize": 0, "household.firstname": ""}}),
});
const data = await response.json();
C#
using var http = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Put, "https://api.nfocus.solutions/v1/portals/riverbend/north/forms/household/answers");
request.Headers.Authorization = new("Bearer", "your_access_token");
request.Content = new StringContent("""
    {"answers": {"household.familySize": 0, "household.firstname": ""}}
    """, System.Text.Encoding.UTF8, "application/json");
using var response = await http.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();

Refused saves:

A valid household save marks the household verified, so its members can register (Household and eligibility guide). The answer to a save is the stored answers, as the GET returns them.

What changed from the current portal