NAV
shell ruby python csharp php

StudentConsequence

The StudentConsequence object

The StudentConsequence object looks like this in JSON:

{
    "object": "student_consequence",
    "id": 1,
    "student_id": 8,
    "consequence_id": 1,
    "description": "Warning Letter to Parents",
    "status": "pending",
    "pending_charge_id": null,
    "added_on": "2022-07-19",
    "added_at": "2022-07-19T16:20:01+00:00",
    "added_by_id": 10,
    "sandbox": true
}
Attribute Required Data Type
id Yes int
student_id Yes int
consequence_id Yes int
description No text
status No enum (pending, applied, waived, deleted)
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)/consequences" \
-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)/consequences',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/people/(person)/consequences',
 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)/consequences"), 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)/consequences');
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_consequence",
            "id": 3,
            "student_id": 12,
            "consequence_id": 1,
            "description": "Warning Letter to Guardians",
            "status": "pending",
            "pending_charge_id": null,
            "added_on": "2022-07-19",
            "added_at": "2022-08-19T16:20:01+00:00",
            "added_by_id": 10
        }
    ],
    "sandbox": true
}

Retrieves all StudentConsequence objects tied to a specific Person.

HTTP Request

GET /people/(person)/consequences

Parameters

None

Permissions

One of the following roles is required to call this method:

index (campus life)

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/campuslife/consequences" \
-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/consequences',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/campuslife/consequences',
 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/consequences"), 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/consequences');
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": 3,
    "results": 3,
    "results_per_page": 200,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "student_consequence",
            "id": 1,
            "student_id": 8,
            "consequence_id": 1,
            "description": "Warning Letter to Parents",
            "status": "pending",
            "pending_charge_id": null,
            "added_on": "2022-07-19",
            "added_at": "2022-07-19T16:20:01+00:00",
            "added_by_id": 10,
            "report_data": {
                "personid": 8,
                "firstname": "Keith",
                "lastname": "Dimeler",
                "preferred_name": "",
                "name": "Written warning",
                "fee_name": null,
                "amount": null,
                "row_id": 1
            }
        }
    ],
    "sandbox": true
}

Retrieves all StudentConsequence objects that match given filter conditions.

HTTP Request

GET /campuslife/consequences

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

Filter Condition Parameters

These conditions can be used to narrow the results returned.

Name Type
first_name text
last_name text
consequence object id
status enum
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:

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/people/(person)/consequences/(studentconsequence)" \
-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)/consequences/(studentconsequence)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/people/(person)/consequences/(studentconsequence)',
 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)/consequences/(studentconsequence)"), 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)/consequences/(studentconsequence)');
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_consequence",
    "id": 2,
    "student_id": 16,
    "consequence_id": 1,
    "description": "Warning Letter to Parents",
    "status": "pending",
    "pending_charge_id": null,
    "added_on": "2022-07-19",
    "added_at": "2022-07-19T16:20:01+00:00",
    "added_by_id": 10,
    "sandbox": true
}

Retrieves a specific StudentConsequence object.

HTTP Request

GET /people/(person)/consequences/(studentconsequence)

Parameters

No additional parameters are needed beyond the ID of the object being requested that appears in the URL.

Expandable Properties

Permissions

One of the following roles is required to call this method: