API Add Project
From zFairs Contest Management
Add Project
You can use our api to add a project and it's participants 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/project', {
method:'POST',
headers:{'Content-Type': 'application/json'},
body: JSON.stringify({
Username:'admin username',
Password: 'password',
FairId: '9df61f13-474b-442f-ac1f-edca7348ef71', //This value can be found in your url it's the value of f
Body: {
Title:'Project Title' //Required
,CategoryId //Required
,Plan: 'Project Plan' // optional
,Abstract: 'Project Abstract'// optional
,Description: 'Project Description'// optional
,CategoryAwardId: 1 // optional
,SpeicalAwardIds: [1, 2] //optional
,Participants : [{
FirstName: 'Jane' //Required
,LastName: 'Doe' //Required
,Grade: 6 //Required
,TeacherId: '9df61f13-474b-442f-ac1f-edca7348ef71' //Required
,SchoolId: 24 //Required
,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'
,Role: 'Student'
,ProfilePicture: { //Optional
Base64String: 'base64 file string',
"FileName": "myAwesomeFileDude.png",
"Caption": "indescribable profile Pic"
}
}],
"Files": [{
"Base64String" : "iVBORw0KGgoAAAANSUhEUgAAAQIAAAA3CAYAAADnj0T6AAAS30lEQVR4Xu2d59NXxRXHD4oNBClSpINIk66giIZYE0vUxDgxGSeJmZRJ3uRF/oH8FclMkomTjJOYNjHWWGI0igUJIk2QJlURpIoggmY+7LN59re/s/fu3nsfysPuG2Z47t27e/bs9/Tz6/Hzxz7/XPLIFMgUOKMp0CMDwRl9/nnzmQLHKZCBIDNCpkCmQAaCzAOZApkCWSPIPJApkCmQTYPMA5kCmQLZR5B5IFMgUyA7CzMPZAqcrhQY1k9k1kiR0QNELrpAZNV7Iv94q/puctSgOu3ym5kCJ5wClw4SuXGSyNC+Ij16mM9/9rnI6xtFnllVfTkZCKrTLr+ZKXBCKYAGAAj0Pq/1s0ePibzwjsjC9dWXk4GgOu3ym5kCJ4wC4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JrRHshlvnqxHj+hoTW8NQKFs1AYCzSHDBcMZAxPj5KIAw83HByRQw/ED0GKryd/P43vEg/kXm9r9RaMjx8zvBEAYwmV1mljS9df+SAsMtHWvyEtr48yZskOxf/eZKZQM48e/Ye6F6wywpgyYij2RJg7t7MXpyvOy68MPQijY/kxelShG0V6Zn3RwckMQUDbSghbYBJjFAAEASouzMi0t5cx4VjPx2B/8iHCKGbWBQHMU5l89jiF9+TN+/j4XnB9mgZlAe2xE+hLwr1XXUesBuCqFXuUryk/EUsBqIXSxO3jEJKIh8LriF6gQsvxOBj8hAMjR8YlfR0oBuNpAoDkK65a0xhK7uz+nefaL9ozNTsjzKa+NenenU95ffQrUBgLfUZgaj66/he49A0CLuu7/zoO/a2zql9ebnnx5ZAqkUqAWEGix67oFLKkbOBOeJ7KC/Uz+g817sL/iTH8BvPspvRXOBJrlPaZRoBYQaCm+dSqg0paen84UyBRoigK1gED7HbauiJU2tdk8T6ZApoBOgVpAkB2Fma0yBboHBWoBQXYUdg8myLvIFKgMBNlRmJknU6D7UKAyEGiOwtQ+9t2HjHknmQKnNwUqA0HTPQpPbzLm1WcKnN4U+B+rAtxGW3zlPAAAAABJRU5ErkJggg==",
"FileName": "myAwesomeFile.png",
"Caption": "indescribable"
},
{
"Base64String" : "file String Here",
"FileName": "myAwesomeFile2.png",
"Caption": "indescribable also"
},
{
"Base64String" : "file string here",
"FileName": "myAwesomething.pdf",
"Caption": "indescribable pdf"
}]
}
})
})
.then(response => response.json())
.then(data=>{console.log('Success: ',data);})
.catch((error)=>{console.log('Error: ', error);});
Where to get values
Various fields need id values such as CategoryId, CategoryAwardId, and SpecialAwardIds. You can get these values from our API. Check out API Get Info
Additional Optional fields of Participants
A participant record is very similar to a teacher record see API Add Person for optional fields of participants.