Loading...

Bully listIncidents

Request Description

Returns all bullying incidents in the database between a given date range. Results can be filtered through parameters passed to list only incidents involving specific students, categories or staff.

Victim and Bully returns are wrapped in HTML anchors. These can be removed by using strip_tags()


Request Information

Response Format:JSON
Requires Authentication:Yes
Cached:Yes
Cache Duration:Indefinitely until an incident is added/deleted

Parameters

id
Optional
ID of specific incident.
date_from
Optional
Date to check from provided in the format of YYYY-MM-DD.
If not supplied default value of the start of the academic year will be used (last occurance of 2nd September).
date_to
Optional
Date to check up to for incidents in the format of YY-MM-DD.
If not supplied, the default value will be the date of when the request was made (today).
bully_id
Optional
Provide a person ID of a student to check for any incidents where this student ID was a suspected bully.
victim_id
Optional
Provide a person ID of a student to check for any incidents where this student ID was a suspected victim.
cats
Optional
Provide a category (such as Cyber) to retireve all incidents that come under the category.
staff_id
Optional
Provide a person ID of a member of staff to check for any incidents which the staff member logged.
limit
Optional
Numeric value to limit how many results are returned. If for example you only want to see ten incidents, use 10 as a value.

Example Request

$a = $api->sendRequest(
  array( 
    'controller'    => 'Bully',  
    'action'        => 'listIncidents',
    'id'            => '',
    'date_from'     => '',
    'date_to'       => '',
    'bully_id'      => '',
    'victim_id'     => '',
    'cats'          => '',
    'staff_id'      => '',
    'limit'         => ''
  )
);

Example Result

Array
(
    [result] => Success
    [data] => Array
        (
            [9] => Array
                (
                    [BULLY] => <a href="/bully/10875">Harris, Tom (08)</a>
                    [VICTIM] => <a href="/bully/1504">Wilkes, Peter (08)</a>
                    [DATE] => 22/04/2015
                    [INFO] => Unkind comments towards Peter
                    [CAT] => Verbal
                    [STAFF] => T Fisher
                    [STATUS] => Resolved
                )

            [10] => Array
                (
                    [BULLY] => <a href="/bully/10834">Bailey, Joanna (09)</a><br><a href="/bully/1245233">Dyer, David (10)</a><br>
                    [VICTIM] => <a href="/bully/145321">Smith, Phoebe (09)</a>
                    [DATE] => 29/04/2015
                    [INFO] => Unpleasant name calling being looked into
                    [CAT] => Cyber
                    [STAFF] => J Hardy
                    [STATUS] => Resolved
                )
                
        )

    [count] => 2
)