Difference between revisions of "API Add Person"
From zFairs Contest Management
Line 38: | Line 38: | ||
All of these fields would be part of the body. | All of these fields would be part of the body. | ||
− | * Username (string max length 25) | + | * '''Username''' (string max length 25) |
**If this username is not available one will be assigned | **If this username is not available one will be assigned | ||
− | * Password (string max length 25) | + | * '''Password''' (string max length 25) |
− | * HighestLevelOfEducation | + | * '''HighestLevelOfEducation''' |
**Less Than HS Graduate | **Less Than HS Graduate | ||
**High School Diploma or Equivalent | **High School Diploma or Equivalent | ||
Line 53: | Line 53: | ||
**Doctorate (Professional) | **Doctorate (Professional) | ||
**Not Indicated | **Not Indicated | ||
− | *JobTitle | + | *'''JobTitle''' |
− | *Employer | + | *'''Employer''' |
− | *JudgesPreferences (object) | + | *'''JudgesPreferences''' (object) |
**this is an object, which can be added to body. like JudgesPreferences: { /* add the following optional parameters below */} | **this is an object, which can be added to body. like JudgesPreferences: { /* add the following optional parameters below */} | ||
− | ***Category1 (int) | + | ***'''Category1''' (int) |
− | ***Category2 (int) | + | ***'''Category2''' (int) |
− | ***Category3 (int) | + | ***'''Category3''' (int) |
− | ***PreviouslyJudged (boolean true/false) | + | ***'''PreviouslyJudged''' (boolean true/false) |
− | ***JudgingSessions (int array) | + | ***'''JudgingSessions''' (int array) |
****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. |
Revision as of 10:31, 4 September 2020
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({
Username:'admin username',
Password: 'password',
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}
}
})
})
.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)
- 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
- JudgesPreferences (object)
- this is an object, which can be added to body. like JudgesPreferences: { /* add the following optional parameters below */}
- 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.
- this is an object, which can be added to body. like JudgesPreferences: { /* add the following optional parameters below */}