Difference between revisions of "API Add Person"

From zFairs Contest Management
 
(8 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
     headers:{'Content-Type': 'application/json'},
 
     headers:{'Content-Type': 'application/json'},
 
     body: JSON.stringify({
 
     body: JSON.stringify({
            Username:'admin username',
+
ApiKey:'<Private key>',
            Password: 'password',
+
FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
            FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
+
Body: {
            Body: {
+
FirstName: 'Jane'
                        FirstName: 'Jane'
 
 
,LastName: 'Doe'
 
,LastName: 'Doe'
 
,Prefix: 'Dr'
 
,Prefix: 'Dr'
Line 26: Line 25:
 
,SchoolsTeachesAt: [1] // int array of school ids
 
,SchoolsTeachesAt: [1] // int array of school ids
 
,Role: 'Teacher' // { Teacher, Judge, Staff, Admin, Volunteer}
 
,Role: 'Teacher' // { Teacher, Judge, Staff, Admin, Volunteer}
 +
,Language:'Spanish' //optional - interpreter need for this language
 
,JudgesPreferences:{ //optional
 
,JudgesPreferences:{ //optional
 
  Category1: 123,
 
  Category1: 123,
Line 47: Line 47:
 
* '''Password''' (string max length 25)
 
* '''Password''' (string max length 25)
 
* '''Middle Name'''
 
* '''Middle Name'''
* '''ExternalId'''
+
* '''ExternalId''' (string: can be used to match to your records)
 
* '''Race'''
 
* '''Race'''
 
* '''Ethnicity'''
 
* '''Ethnicity'''
Line 93: Line 93:
 
****Not provided will not update sessions, empty array will clear out sessions for that judge.
 
****Not provided will not update sessions, empty array will clear out sessions for that judge.
 
****example [] or [1,2,...]
 
****example [] or [1,2,...]
 +
*'''IsSpecialAwardJudge''' (boolean true/false)
 +
*'''IsModerator''' (boolean true/false)
 +
*'''IsInterpreter''' (boolean true/false)
 +
*'''RequirePasswordChange''' (boolean true/false) requires user to change password on their first sign-in.
 +
 +
 +
=== Notes ===
 +
 +
When you call the /person API you can set the username, if the username you provided is not available we add a number to the end of it. Spaces are removed from the username. 
 +
 +
If you do not provide a password when you call the /person api then none is set and the account will need to have a password set before you can login with this person. A user can use their name and email to reset the password.
 +
 +
<br/><br/><br/><br/>
 +
[[Category: API]]

Latest revision as of 20:47, 10 April 2024

Add Person

You can use our api to add a teacher or judge to your contest. To do this you need to POST a message to your site. Below is an example of what needs to be posted.

fetch('/api/data/person', {
    method:'POST',
    headers:{'Content-Type': 'application/json'},
    body: JSON.stringify({
		ApiKey:'<Private key>',
		FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
		Body: {
			FirstName: 'Jane'
			,LastName: 'Doe'
			,Prefix: 'Dr'
			,Email: 'jane@example.com'
			,Email1: 'Doe@example.com'
			,Phone: '800-000-0000'
			,Phone1: '800-123-1324'
			,Address: '1219 45th st'
			,Address2: 'APT 3B'
			,City: 'Ogden'
			,State: 'VA'
			,Zip: '65951'
			,SchoolsTeachesAt: [1] // int array of school ids
			,Role: 'Teacher' // { Teacher, Judge, Staff, Admin, Volunteer}
			,Language:'Spanish' //optional - interpreter need for this language
			,JudgesPreferences:{ //optional
			   Category1: 123,
			   ...
			}
            }
        })
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});


Additional Optional fields

All of these fields would be part of the body.

  • Username (string max length 25)
    • If this username is not available one will be assigned
  • Password (string max length 25)
  • Middle Name
  • ExternalId (string: can be used to match to your records)
  • Race
  • Ethnicity
    • African American
    • Asian/Pacific Islander
    • Caucasian
    • Hispanic
    • Indian/So. Asian
    • Native American
    • Unknown/Declined to state
  • Gender
    • F = Female
    • M = Male
    • O = Other
    • N = Non-binary
    • Z = Prefer not to answer
  • HighestLevelOfEducation
    • Less Than HS Graduate
    • High School Diploma or Equivalent
    • Some College
    • Technical School
    • 2-Year College Degree
    • 4-Year College Degree
    • Some Graduate School
    • Master's Level Degree
    • Doctorate (Academic)
    • Doctorate (Professional)
    • Not Indicated
  • JobTitle
  • Employer
  • DateOfBirth (yyyy-mm-dd)
  • FullLegalName
  • BackgroundcheckAtUtc (yyyy-mm-dd)
  • BackgroundCheckStatus
  • JudgesPreferences (object)
    • this is an object, which can be added to body. like JudgesPreferences: { /* add the following optional parameters below */}
    • you need to provide the category id's in the category1-3
    • you need to provide judging Session id's for judgingSessions array
    • See API_Get_Info to get these id's
      • Category1 (int)
      • Category2 (int)
      • Category3 (int)
      • PreviouslyJudged (boolean true/false)
      • JudgingSessions (int array)
        • Not provided will not update sessions, empty array will clear out sessions for that judge.
        • example [] or [1,2,...]
  • IsSpecialAwardJudge (boolean true/false)
  • IsModerator (boolean true/false)
  • IsInterpreter (boolean true/false)
  • RequirePasswordChange (boolean true/false) requires user to change password on their first sign-in.


Notes

When you call the /person API you can set the username, if the username you provided is not available we add a number to the end of it. Spaces are removed from the username.

If you do not provide a password when you call the /person api then none is set and the account will need to have a password set before you can login with this person. A user can use their name and email to reset the password.