Skip to main content
All CollectionsFor DevelopersSportsEngine API
Getting Registrations and Results
Getting Registrations and Results

Retrieve registration details, questions, choices, and the registration results for each profile.

Updated over 10 months ago

There are two components of registration: schema and results. The Registration schema contains all the high-level attributes, forms, questions, and available answer choices. The second component is registration results, which store profile responses for each question.

It is important to note that registration results contain a snapshot of profile data during registration. It is best practice to use the profile query for profile data because that will collect the latest information across all registrations, memberships, SportsEngine HQ, organizations, and mobile apps.

Query by Registration ID

If you know the SportsEngine registration ID, use it to access the desired registration. This function is the most basic query and will typically be used to look up information after receiving webhook notifications.

query Registration { 
registration(id: 46575456) {
id
close
created
indexed
monetary
name
open
resultsCompleted
sport
status
updated
url
}
}

The registration will contain a webpage URL for people to submit a new result. The URL will display without worrying about status or open/close dates. The platform will dynamically allow/disallow new results based on these settings. Open and close dates can be null as they are used to schedule the start and end of registrations. The registration status is the most crucial attribute to know if a registration accepts more results.

{ 
"data": {
"registration": {
"id": "46575456",
"close": "2023-05-16T06:59:00.000Z",
"created": "2008-07-23T22:55:07.000Z",
"indexed": false,
"monetary": true,
"name": "2022-2023 Registration",
"open": null,
"resultsCompleted": 42,
"status": 2,
"updated": "2023-03-07T22:05:18.000Z",
"url": "https://www.sportngin.com/register/form/46575456"
}
}
}

For privacy reasons, background screening registrations are not accessible through the API.

Get All Registrations for an Organization

Access registrations through the organization or registration queries. Using the organization query will require navigating nested pagination (see the First GraphQL Query article for code examples).

query Registrations { 
registrations(id: 12345) {
pageInformation {
pages
count
page
perPage
}
results {
id
close
created
indexed
monetary
name
open
resultsCompleted
status
updated
url
}
}
}

A few helpful reminders about registrations: the resultsCompleted is a real-time indicator of how many results connect to this registration. If a profile completes the registrations two times, it will increase the count by two. Registrations are not required to be connected to a profile if they do not require login.

Bringing Together Forms, Questions, and Choices

Forms and questions are what make up a registration. A form is a user interface that groups questions and profiles on one page. Registrations have a minimum of one form and commonly comprise multiple forms. Forms can contain a list of questions but are not required to have questions – which will typically happen on welcome pages.

query Registrations{ 
registration(id: 12345) {
pageInformation {
pages
count
page
perPage
}
results(page: 1, perPage: 10) {
forms {
id
name
questions {
key
name
type
choices {
id
name
position
}
}
}
id
name
}
}
}

The response can get lengthy as this request will return all forms, questions, and choices for the registration.

{ 
"data": {
"organization": {
"id": "10",
"registrations": [
{
"forms": [
{
"id": "544",
"name": "New for 2008-2009",
"questions": [
{
"key": "qu_el_2886-string",
"name": "2008-2009 Changes",
"type": "checkbox",
"choices": [
{
"id": "3203",
"name": "I understand and accept the 2008-2009 Changes",
"position": 1
}
]
}
]
},
{
"id": "468",
"name": "Code of Conduct",
"questions": [
{
"key": "qu_el_2495-string",
"name": "Code of Conduct",
"type": "checkbox",
"choices": [
{
"id": "2648",
"name": "I accept the Code of Conduct Policy",
"position": 1
}
]
}
]
},
{
"id": "469",
"name": "Consent to Treat and USA Waiver of Liability",
"questions": [
{
"key": "qu_el_2496-string",
"name": "Consent to Treat and USA Waiver of Liability",
"type": "checkbox",
"choices": [
{
"id": "2649",
"name": "I accept the Consent to Treat and USA Waiver of Liability Policy",
"position": 1
}
]
}
]
}

Question types of pulldown (I.e., dropdown), radio, and checkbox have choices that profiles can choose from when completing the registration. Choices are stored using an ID that returns in registration results.

Getting Registration Results

There are two different ways to access results. If you know the profile ID, you can access every registration result for a profile in an organization via the profile query.

query Profile { 
profile(id: 45345, organizationId: 12345) {
id
firstName
lastName
registrationResults {
pageInformation {
pages
count
page
perPage
}
results {
id
registrationId
registrationName
created
updated
answers {
name
format
value
}
sale {
id
status
}
}
}
}
}

The second option is to use a profiles query filter. The profiles query filter will show profiles that have completed a specific registration. The filter is set up similarly to Directory filters in SportsEngine HQ. It requires a source (registration), source ID (registration ID), operator, key (registration_submitted), and a value of true since that key is a boolean.

query Profiles { 
profiles(
filter: {
key: registration_submitted
value: "true"
source: registration
sourceId: "46575456"
operator: equal
}
organizationId: 12345
) {
pageInformation {
count
page
pages
perPage
}
results {
firstName
lastName
id
}
}
}

Once you have a list of profiles, you can iterate through them and retrieve their registration answers.

Formatting Registration Result Answers

The power of flexible registration questions means that answers can be in several formats. To support that flexibility, Registration Answers leverage GraphQL Interfaces to access all aspects of an answer value. Below is a list of the different answer.format types and the GraphQL Interface to access the answer values.

Answer Format

Interface Implementation

string date

StringRegistrationResultAnswer

array (strings)

ArrayRegistrationResultAnswer

decimal

integer

length

donation

monetary

NumberRegistrationResultAnswer

document_upload

UploadRegistrationResultAnswer

profile_photo

ProfilePhotoRegistrationResultAnswer

Here is a query to get the registration answers that include all supported interfaces. It is important to note that if you have a multiple-choice question, the answers will populate as an array of strings.

query Profile { 
profile(id: 45345, organizationId: 12345) {
id
firstName
lastName
registrationResults {
pageInformation {
pages
count
page
perPage
}
results {
id
registrationId
registrationName
created
updated
answers {
name
format
...on ArrayRegistrationResultAnswer {
arrayValue: value
}
...on NumberRegistrationResultAnswer{
numberValue: value
}
...on StringRegistrationResultAnswer {
stringValue: value
}
...on UploadRegistrationResultAnswer{
uploadValue: value {
filename
filetype
url
}
}
...on ProfilePhotoRegistrationResultAnswer {
profilePhotoValue: value {
imageType
url
}
}
}
sale {
id
status
}
}
}
}
}

If you encounter an error when retrieving answers, examine your interface mappings with the answer formats in your registration.

Profile Versus Registration Data

Most registrations include SportsEngine Profile Fields. Profile data automatically updates when profile fields are present in the registration. Registrations are a snapshot of profile data at the time of registration. Profile data is the latest and greatest across all registrations, memberships, and account updates.

We recommend using profile data versus registration data whenever possible.

Did this answer your question?