StudentViolation
The StudentViolation object
The StudentViolation object looks like this in JSON:
{
"object": "student_violation",
"id": 1,
"student_id": 12,
"violation_id": 1,
"description": "Curfew Violation, after midnight",
"pending_charge_id": null,
"added_on": "2022-07-19",
"added_at": "2022-07-19T16:19:56+00:00",
"added_by_id": 10,
"sandbox": true
}
| Attribute | Required | Data Type |
|---|---|---|
| id | Yes | int |
| student_id | Yes | int |
| violation_id | Yes | int |
| description | No | text |
| pending_charge_id | No | int |
| added_on | No | date |
| added_at | No | datetime |
| added_by_id | No | int |
| sandbox | No | bool |
index (by person)
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/people/(person)/violations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/people/(person)/violations',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/people/(person)/violations',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/people/(person)/violations"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/people/(person)/violations');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "list",
"count": 1,
"results": 1,
"results_per_page": null,
"pages": 1,
"page": 1,
"offset": 0,
"has_more": false,
"data": [
{
"object": "student_violation",
"id": 1,
"student_id": 12,
"violation_id": 1,
"description": "Curfew Violation, after midnight",
"pending_charge_id": null,
"added_on": "2022-07-19",
"added_at": "2022-07-19T16:19:56+00:00",
"added_by_id": 10
}
],
"sandbox": true
}
Retrieves all StudentViolation objects tied to a specific Person.
HTTP Request
GET /people/(person)/violations
Parameters
None
Permissions
One of the following roles is required to call this method:
- Academic Admin
- Registrar
- Financial Admin
- Campus Life
index (campus life)
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/campuslife/violations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
-d '{
"filter": []
}' \
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/campuslife/violations',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/campuslife/violations',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/campuslife/violations"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/campuslife/violations');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "list",
"count": 2,
"results": 2,
"results_per_page": 200,
"pages": 1,
"page": 1,
"offset": 0,
"has_more": false,
"data": [
{
"object": "student_violation",
"id": 1,
"student_id": 12,
"violation_id": 1,
"description": "Curfew Violation, after midnight",
"pending_charge_id": null,
"added_on": "2022-07-19",
"added_at": "2022-07-19T16:19:56+00:00",
"added_by_id": 10,
"report_data": {
"personid": 12,
"firstname": "Taylor",
"lastname": "Forest",
"preferred_name": "",
"name": "Picked his nose in class",
"fee_name": null,
"amount": null,
"row_id": 1
}
}
],
"sandbox": true
}
Retrieves all StudentViolation objects that match given filter conditions.
HTTP Request
GET /campuslife/violations
Parameters
| Name | Required | Data Type | Description |
|---|---|---|---|
| filter | No | mixed | See available filter conditions |
| page | No | int | The page of results to return if more than 200 records are found. |
Expandable Properties
- violation
Filter Condition Parameters
These conditions can be used to narrow the results returned.
| Name | Type |
|---|---|
| first_name | text |
| last_name | text |
| violation | object id |
| description | text |
| has_fee | bool |
| fee_name | text |
| fee_amount | decimal |
| added_on | date |
| tag | tag |
| custom_field | custom |
Permissions
One of the following roles is required to call this method:
- Academic Admin
- Registrar
- Financial Admin
- Campus Life
show
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/people/(person)/violations/(studentviolation)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/people/(person)/violations/(studentviolation)',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/people/(person)/violations/(studentviolation)',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/people/(person)/violations/(studentviolation)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/people/(person)/violations/(studentviolation)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "student_violation",
"id": 2,
"student_id": 16,
"violation_id": 1,
"description": "Curfew Violation, after midnight",
"pending_charge_id": null,
"added_on": "2022-07-19",
"added_at": "2022-07-19T16:19:56+00:00",
"added_by_id": 10,
"sandbox": true
}
Retrieves a specific StudentViolation object.
HTTP Request
GET /people/(person)/violations/(studentviolation)
Parameters
No additional parameters are needed beyond the ID of the object being requested that appears in the URL.
Expandable Properties
- violation
Permissions
One of the following roles is required to call this method:
- Academic Admin
- Registrar
- Financial Admin
- Campus Life