Advertising sustains the DA. Ads are hidden for members. Join today

On this page

Use

Last updated on
30 April 2025

API Calls

Your code should try to exclusively use API calls.

Here is an example of how to call the fictitious graduateAllProspects function.

    ...
    $results = sonisweb_integration_api("CFC.graduateAllProspects", "graduateThemAll", "yes",
                                                    array(array('adminUsername', '@username'),
                                                            array('reason', $reason)));
    ...

What those things mean.

  • $results holds the results returned by the function.
  • sonisweb_integration_api() The function that actually calls the SONISWEB API.
  • CFC.graduateAllProspects The location of the API call. See your documentation.
  • graduateThemAll The actual function name you are calling.
  • "yes" This is a yes no flag that specifies if the function returns a variable (yes) or outputs text (no). (If one doesn't work try the other.)
  • array(array('adminUsername', '@username'), array('reason', $reason)) The arguments required by the graduateThemAll function.
    • array('adminUsername', '@username') Argument name is adminUsername, value is @username (Note: @username is a special value. It will dynamically be replaced by the Administrative Username stored by this module. @password will be similarly be replaced.)
    • array('reason', $reason) Argument name is reason, Argument Value will be $reason

SQL Calls

This functionality should only be used sparingly.

    ...
    $results = sonisweb_integration_sql($sql);
    ...
  • sonisweb_integration_sql() The function that actually makes the SONISWEB API call.
  • $sql The SQL Command you wish to run. (Note: Tha API will only run select commands. However, you are still responsible for preventing SQL Injection attacks
  • $results The SQL results. They are returned in a 2D associative array with the rows numbered and the columns are named. (i.e. 0 => ([course] => 'English', ...), 1 => ([course] => 'Math', ...))

Help improve this page

Page status: Not set

You can: