Registrants
Every survey is completed by a user. These registrants may be solo users or part of a family or group of users. In all cases, the registrant's information can be accessed to be used for contact information or to just create a visual representation of their household/team/group.
getUser Personas
id
Integer
Id of the persona
first_name
String
First name of the persona
last_name
String
Last name of the persona
persona_type
String
Type of persona (self, team, group, orphan, other)
profile_image_url
String
URL pointing to location of profile image
date_of_birth
String
Date of birth (DD/MM/YYYY)
age
Integer
Age of persona
phone_numbers
Array of Objects
Array of Persona phone numbers
addresses
Array of Objects
Array of Persona addresses
email_addresses
Array of Objects
Array of email addresses
Definition
Examples
Result Format
[
{
"id": 19433608,
"first_name": "API",
"last_name": "User",
"persona_type": "self",
"profile_image_url": "/app_images/avatar_boy.svg",
"date_of_birth": "01/01/1981",
"age": 35,
"phone_numbers": [],
"addresses": [],
"email_addresses": [
{
"address": "[email protected]",
"label": null,
"enabled": false,
"alerts": false
}
]
}
]
Surveys
Surveys are the foundation of Registration - every Registration is a Survey. Registration is comprised of four separate components:
- A representation of the activity taken by an individual to fill-out the form/survey/registration. Several users fill out the form, thereby generating a set of answers that need to be stored. The list of users' activity filling out the form is accessible via the API using the Survey Results Index endpoint, and the values themselves are accessible using the Survey Results Answers Index endpoint.
- A common typing system provides a set of re-usable parts, which allows form-editors to build surveys/registrations quickly. These parts are accessible via the API using the Question Elements endpoint.
- A reporting mechanism allowing for a denormalized export of some or all of the data captured over the life of the form/survey/registration. The survey report is accessible via the API using the Surveys Report endpoint.
Associations
Surveys belongs to Sites.
getSurveys Index
The Index method returns an array of Surveys owned by the Organization represented by the site_id
parameter. An error is thrown if any of the parameters are invalid. The Survey object itself represents the attributes of the Survey itself, its type, the rules by how it functions, and what it allows users to do.
Parameters
Query Params
Unique identifier for a site on the Sport Ngin platform.
id
Integer
Id of survey
name
String
Name of survey
site_id
Integer
Id of site that the survey belongs to
created_at
DateTime
Timestamp when created
updated_at
DateTime
Timestamp of last update
status
Integer
0 = Disabled
1 = Enabled
2 = Archived
3 = Reviewable
4 = Under Construction
tst_rate_group_num
Integer
Code that references the fee setup for the survey
code
String
Internal reference code
survey_type
String
registration, group, site_member
registrar_emails
String
Email addresses receiving notification of each survey completion
allow_multiple_registrations
Boolean
When true, the survey can be filled out more than once by a given profile
next_event
Boolean
When true, denotes that the survey is tied to a Next Testing event
rep_user_id
Integer
Unique ID assigned by Sport Ngin
monetary
Boolean
When true, the survey is collecting money
open_date
DateTime
Future date registration will be open to be completed
close_date
DateTime
Future date registration will no longer be available
bank_account_id
Integer
Unique ID representing a bank account used for transferring profits
merchant_account_id
Integer
Unique ID representing a merchant account used to process transactions
custom_message
String
Message to be displayed on receipt email
login_optional
Boolean
When true, the user is not required to log in to complete the survey
user_id
Integer
Unique id representing the user in the Sport Ngin system
has_barcode
Boolean
When true, denotes that the survey has a barcode associated with it
barcode_type
String
A field that allows the survey creator to select from a set of standard barcode types
group_range
Serialized String
Minimum/maximum number of individuals that can fill out a group registration
group_range_question_element_id
Integer
Id of QuestionElement that is used to determine group_range
editable_by_user
Boolean
When true, denotes that the survey is editable by the user after submission
form_label
String
Group/team label for group registrations
sub_form_label
String
Individual/player label for group registrations
custom_css
String
???Custom css to adjust the look of the survey??? NOT NEEDED?
user_can_add_entries
Boolean
When true, denotes that the user can add their own entries to the survey after it has been completed
skip_welcome_page
Boolean
When true, denotes that the survey will skip the welcome page and start on the first question form
event_id
Integer
Id of event that is associated with the survey
customer_pays_fee
Boolean
When true, denotes that the customer will pay the transaction and processing fees
offer_id
Integer
??REMOVE??? Not used.
allow_amex
Boolean
When true, denotes that the user can pay using American Express
next_form_text_override
String
???REMOVE??? Next testing.
restrict_invite
Boolean
When true, denotes that the survey will not automatically invite unregistered users
background_screen_enabled
Boolean
When true, denotes that the survey is a background screen
approval_user_id
Integer
???Sport Ngin user ID of survey admin???NEEDED?
Definition
Examples
Result Format
[
{
"id": 99164,
"name": "Member Questions",
"site_id": 11953,
"created_at": "2016-02-24T06:32:26-08:00",
"updated_at": "2016-02-24T06:32:26-08:00",
"status": 0,
"tst_rate_group_num": 1,
"code": "377379173",
"survey_type": "site_member",
"registrar_emails": null,
"allow_multiple_registrations": false,
"next_event": false,
"rep_user_id": null,
"monetary": false,
"open_date": null,
"close_date": null,
"bank_account_id": null,
"merchant_account_id": null,
"custom_message": null,
"login_optional": true,
"user_id": null,
"has_barcode": false,
"barcode_type": null,
"group_range": null,
"group_range_question_element_id": null,
"editable_by_user": true,
"form_label": "",
"sub_form_label": "",
"custom_css": null,
"user_can_add_entries": true,
"skip_welcome_page": true,
"event_id": null,
"customer_pays_fee": null,
"offer_id": null,
"allow_amex": false,
"next_form_text_override": null,
"restrict_invite": false,
"background_screen_enabled": false,
"approval_user_id": null
},
{
"id": 99825,
"name": "2016 Player Registration",
"site_id": 11953,
"created_at": "2016-02-26T07:16:42-08:00",
"updated_at": "2016-03-16T08:49:37-07:00",
"status": 1,
"tst_rate_group_num": 66,
"code": "673138012",
"survey_type": "registration",
"registrar_emails": "[email protected]",
"allow_multiple_registrations": false,
"next_event": false,
"rep_user_id": null,
"monetary": false,
"open_date": null,
"close_date": null,
"bank_account_id": null,
"merchant_account_id": null,
"custom_message": "",
"login_optional": false,
"user_id": 3156422,
"has_barcode": false,
"barcode_type": "",
"group_range": null,
"group_range_question_element_id": null,
"editable_by_user": false,
"form_label": "Player",
"sub_form_label": "",
"custom_css": "",
"user_can_add_entries": false,
"skip_welcome_page": false,
"event_id": null,
"customer_pays_fee": null,
"offer_id": null,
"allow_amex": false,
"next_form_text_override": "",
"restrict_invite": false,
"background_screen_enabled": false,
"approval_user_id": 3156422
},
{
"id": 102760,
"name": "Test Reg",
"site_id": 11953,
"created_at": "2016-03-11T12:53:48-08:00",
"updated_at": "2016-03-11T12:54:55-08:00",
"status": 1,
"tst_rate_group_num": 66,
"code": "710295654",
"survey_type": "registration",
"registrar_emails": "",
"allow_multiple_registrations": false,
"next_event": false,
"rep_user_id": null,
"monetary": false,
"open_date": null,
"close_date": null,
"bank_account_id": null,
"merchant_account_id": null,
"custom_message": "",
"login_optional": false,
"user_id": 3156422,
"has_barcode": false,
"barcode_type": "",
"group_range": null,
"group_range_question_element_id": null,
"editable_by_user": false,
"form_label": "",
"sub_form_label": "",
"custom_css": "",
"user_can_add_entries": false,
"skip_welcome_page": false,
"event_id": null,
"customer_pays_fee": null,
"offer_id": null,
"allow_amex": false,
"next_form_text_override": "",
"restrict_invite": false,
"background_screen_enabled": false,
"approval_user_id": 3156422
},
{
"id": 104553,
"name": "2016 Hockey Registration",
"site_id": 11953,
"created_at": "2016-03-23T09:40:07-07:00",
"updated_at": "2016-03-23T09:52:57-07:00",
"status": 1,
"tst_rate_group_num": 66,
"code": "895470882",
"survey_type": "registration",
"registrar_emails": "",
"allow_multiple_registrations": false,
"next_event": false,
"rep_user_id": null,
"monetary": false,
"open_date": null,
"close_date": null,
"bank_account_id": null,
"merchant_account_id": null,
"custom_message": "",
"login_optional": false,
"user_id": 3156422,
"has_barcode": false,
"barcode_type": "",
"group_range": null,
"group_range_question_element_id": null,
"editable_by_user": false,
"form_label": "Player",
"sub_form_label": "",
"custom_css": "",
"user_can_add_entries": false,
"skip_welcome_page": false,
"event_id": null,
"customer_pays_fee": null,
"offer_id": null,
"allow_amex": false,
"next_form_text_override": "",
"restrict_invite": false,
"background_screen_enabled": false,
"approval_user_id": 3156422
}
]
getSurvey Results Index
The Index method returns an array of Survey Results for the given survey_id
. A survey result represents a specific occurrence of a completed survey. An error is thrown if any parameters are invalid.
Parameters
Query Params
Id of the Survey the SurveyResult belongs to
id
Integer
Unique id of the survey_result
survey_id
Integer
Unique Id of the Survey the SurveyResult belongs to
persona_id
Integer
Unique id representing the specific person or team that completed the survey
created_at
Datetime
Timestamp of creation date
updated_at
Datetime
Timestamp of last update
order_id
Integer
Unique id representing a specific order if the survey was part of a purchase transaction
completed
Boolean
Boolean representing status of survey_result
user_id
Integer
Unique id representing the user account attached to the survey_result
status
String
Entry status used for sales transactions
barcode_image_id
String
Unique id representing a barcode image file tied to a purchase transaction
roster_player_id
Integer
Unique id representing a registered player that has been placed on a team
placed_at
Datetime
Timestamp of order placement
Definition
Examples
Result Format
[
{
"id": 16953112,
"survey_id": 104553,
"persona_id": 18922209,
"created_at": "2016-03-23T09:58:37-07:00",
"updated_at": "2016-03-23T10:07:47-07:00",
"order_id": null,
"completed": true,
"user_id": null,
"status": "Active",
"barcode_image_id": null,
"roster_player_id": 11575453,
"placed_at": "2016-03-23T09:58:47-07:00"
},
{
"id": 16953223,
"survey_id": 104553,
"persona_id": 18922316,
"created_at": "2016-03-23T10:03:36-07:00",
"updated_at": "2016-03-23T10:07:48-07:00",
"order_id": null,
"completed": true,
"user_id": null,
"status": "Active",
"barcode_image_id": null,
"roster_player_id": 11575454,
"placed_at": "2016-03-23T10:03:38-07:00"
},
{
"id": 16953243,
"survey_id": 104553,
"persona_id": 18922324,
"created_at": "2016-03-23T10:04:16-07:00",
"updated_at": "2016-03-23T10:07:48-07:00",
"order_id": null,
"completed": true,
"user_id": null,
"status": "Active",
"barcode_image_id": null,
"roster_player_id": 11575455,
"placed_at": "2016-03-23T10:04:24-07:00"
},
{
"id": 16953262,
"survey_id": 104553,
"persona_id": 18922330,
"created_at": "2016-03-23T10:04:55-07:00",
"updated_at": "2016-03-23T10:07:52-07:00",
"order_id": null,
"completed": true,
"user_id": null,
"status": "Active",
"barcode_image_id": null,
"roster_player_id": 11575456,
"placed_at": "2016-03-23T10:05:01-07:00"
},
{
"id": 16953280,
"survey_id": 104553,
"persona_id": 18922338,
"created_at": "2016-03-23T10:05:40-07:00",
"updated_at": "2016-03-23T10:07:54-07:00",
"order_id": null,
"completed": true,
"user_id": null,
"status": "Active",
"barcode_image_id": null,
"roster_player_id": 11575457,
"placed_at": "2016-03-23T10:05:42-07:00"
},
]
getSurvey Results Answers Index
The Survey Results Answers Index endpoint returns the Answers to the Question Elements for the given survey_result_id
. A survey result represents a specific occurrence of a completed survey. An error is thrown if any parameters are invalid.
Parameters
Path Params
Id of the SurveyResult of interest
id
Integer
Unique id of the survey_result
survey_id
Integer
Unique Id of the Survey the SurveyResult belongs to
persona_id
Integer
Unique id representing the specific person or team that completed the survey
created_at
Datetime
Timestamp of creation date
updated_at
Datetime
Timestamp of last update
order_id
Integer
Unique id representing a specific order if the survey was part of a purchase transaction
completed
Boolean
Boolean representing status of survey_result
user_id
Integer
Unique id representing the user account attached to the survey_result
status
String
Entry status used for sales transactions
barcode_image_id
String
Unique id representing a barcode image file tied to a purchase transaction
roster_player_id
Integer
Unique id representing a registered player that has been placed on a team
placed_at
Datetime
Timestamp of order placement
Definition
Examples
Result Format
{
"first_name": "Christopher",
"last_name": "Breen",
"hometown": "UXBRIDGE, ON, CAN",
"birthdate": "06/29/1989"
}
putSurvey Results Answers Update
The Update method accepts a single Survey Result and updates the matching record in Sport Ngin. A survey result represents a specific occurrence of a completed survey. An error is thrown if any parameters are invalid.
Parameters
Path Params
Id of the SurveyResult of interest
id
Integer
Unique id of the survey_result
survey_id
Integer
Unique Id of the Survey the SurveyResult belongs to
persona_id
Integer
Unique id representing the specific person or team that completed the survey
created_at
Datetime
Timestamp of creation date
updated_at
Datetime
Timestamp of last update
order_id
Integer
Unique id representing a specific order if the survey was part of a purchase transaction
completed
Boolean
Boolean representing status of survey_result
user_id
Integer
Unique id representing the user account attached to the survey_result
status
String
Entry status used for sales transactions
barcode_image_id
String
Unique id representing a barcode image file tied to a purchase transaction
roster_player_id
Integer
Unique id representing a registered player that has been placed on a team
placed_at
Datetime
Timestamp of order placement
Definition
Examples
Result Format
{
"first_name": "Christopher",
"last_name": "Smith",
"hometown": "UXBRIDGE, ON, CAN",
"birthdate": "06/29/1989"
}
Definition
Examples
Result Format
[
{
"id": 3526476,
"question_id": 1,
"report_name": "First Name"
},
{
"id": 3526477,
"question_id": 2,
"report_name": "Last Name"
},
{
"id": 3526481,
"question_id": 550614,
"report_name": "Hometown"
},
{
"id": 3526483,
"question_id": 4,
"report_name": "Birthdate"
},
{
"id": 3526672,
"question_id": 1500247,
"report_name": "Position"
}
]
getSurveys Report
The specialized Report method returns a list of all answers provided by the registrants for the a survey for the given survey_id
in a de-normalized format. An error is thrown if any of the parameters are invalid.
Parameters
Path Params
Id of the survey of interest
Query Params
Id of the saved report of interest
survey_result_id
Integer
Id of the survey result specific to the provided survey
order_number
Integer
Unique ID generated when a survey is monetary registration
item_payment_status
String
Payment status of the monetary registration
registration_date
DateTime
Date and time the survey was completed
account_email
String
Email of the account filling out the survey
secondary_email
String
Secondary email of the account filling out the survey
entry_status
Enum
Status of a particular entry on a survey (Active or Inactive)
is_orphan
Boolean
When true, the user that filled out the survey has not yet accepted their invitation to the Sport Ngin platform
qu_el_xxxxxxx
String
The answer for the listed question element
Definition
Examples
curl -X GET -H "Authorization: Bearer ACCESS_TOKEN" -H "Accept: application/json" -H "NGIN-API-VERSION: 0.1" "https://api.sportngin.com/surveys/104553/report"
Result Format
[
{
"survey_result_id": 16953112,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 9:58am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Christopher",
"qu_el_3526477": "Breen",
"qu_el_3526481": "UXBRIDGE, ON, CAN",
"qu_el_3526483": "06/29/1989",
"qu_el_3526672": "Defense",
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
{
"survey_result_id": 16953223,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 10:03am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Craig",
"qu_el_3526477": "Cunningham",
"qu_el_3526481": "TRAIL, BC, CAN",
"qu_el_3526483": "09/13/1990",
"qu_el_3526672": "Right Wing",
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
{
"survey_result_id": 16953243,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 10:04am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Justin",
"qu_el_3526477": "Florek",
"qu_el_3526481": "MARQUETTE, MI, USA",
"qu_el_3526483": "05/18/1990",
"qu_el_3526672": "Left Wing",
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
{
"survey_result_id": 16953262,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 10:05am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Alexander",
"qu_el_3526477": "Khokhlachev",
"qu_el_3526481": "MOSCOW, RUS",
"qu_el_3526483": "09/09/1993",
"qu_el_3526672": null,
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
{
"survey_result_id": 16953280,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 10:05am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Torey",
"qu_el_3526477": "Krug",
"qu_el_3526481": "LIVONIA, MI, USA",
"qu_el_3526483": "04/12/1991",
"qu_el_3526672": "Defense",
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
{
"survey_result_id": 16953303,
"order_number": null,
"item_payment_status": "''",
"registration_date": "03/23/2016, 10:06am PDT",
"account_email": "",
"secondary_email": "",
"entry_status": "Active",
"is_orphan": "Unclaimed",
"qu_el_3526476": "Tuukka",
"qu_el_3526477": "Rask",
"qu_el_3526481": "SAVONLINNA, FIN",
"qu_el_3526483": "03/10/1987",
"qu_el_3526672": "Goalie",
"rostering_assignment": "Eastern Conference Boston Bears 2016"
},
]