Actions are used with objects to perform different functions.  Some of the actions, like define, simply return data or information about the object or existing records.  Other actions perform a function like adding a record, editing an existing record or deleting information.

define

Return the object definition from the API including the fields, field definitions and available actions for the object.

array(
  "token" => $token,
  "tokenHash" => $tokenHash,
  "objectType" => "events",
  "objectAction" => "define"
)
Array
(
    [status] => ok
    [messages] => Array
        (
            [generalMessages] => Array
                (
                )
            [recordMessages] => Array
                (
                )
        )
    [data] => Array
        (
            [actions] => Array
                (
                    [define] => Array
                        (
                            [modules] => Array
                                (
                                    [0] => Events
                                )
                            [permissions] => Array
                                (
                                    [0] => Volunteer
                                )
                        )
                     // Additional actions would be here...
                )
            [fields] => Array
                (
                    [eventID] => Array
                        (
                            [name] => eventID
                            [friendlyname] => ID
                            [type] => key
                            [lengthMax] =>
                            [lengthMin] =>
                            [default] =>
                            [properties] => Array
                                (
                                )
                        )
                     // Additional fields would be here...
                )
        )
)

add

If a field has a default value, it will be used if you do not include the field when performing an add(). This includes fields that have the "required" property.

Add a record to the database.

edit

Only fields with the "required" property are required in order to edit an object.  If a field is not required and is not included in the data, the value of that field will remain unchanged.

A field with the "valueRequiredOnEdit" property requires a value if you include it in your data. However, you are not required to include the field in your data, in which case the value will remain unchanged.

Edit an existing record in the database.

delete

Delete a record from the database.

view

Return the specified information about a specific record.

array (
  "token" => $token,
  "tokenHash" => $tokenHash,
  "objectType" => "locations",
  "objectAction" => "view"
  "values" => array(
    [0] => array(
      "locationID" => "4668"
    ),
    [1] => array(
      "locationID" => "5227"
    )
  ),
  "fields" => array("locationID", "locationName", "locationPostalcode")
)

search

Search all available records using the specified search criteria.

list

The list action is meant to be used to populate HTML drop downs.  The returned values include the key (value) and the name or text of the item.

Most list() actions are limited to 500 rows. If you need to return more than 500 rows you should use the search() method.

array (
  "token" => $token,
  "tokenHash" => $tokenHash,
  "objectType" => "species",
  "objectAction" => "list"
)
Array
(
  [status] => ok
  [messages] => Array (
    [generalMessages] => Array ( )
    [recordMessages] => Array ( )
  )
  [data] => Array (
    [species] => Array (
      [Alpacas] => Array (
        [name] => Alpacas
        [singular] => Alpacas
        [plural] => Alpacas
        [singularYoung] => Alpacas
        [pluralYoung] => Alpacas
      )
      [Birds] => Array (
        [name] => Birds
        [singular] => Birds
        [plural] => Birds
        [singularYoung] => Birds
        [pluralYoung] => Birds
      ),
      [Cats] => Array (
        [name] => Cats
        [singular] => Cats
        [plural] => Cats
        [singularYoung] => Cats
        [pluralYoung] => Cats
      )
      // More species included here...
    )
  )
)

updateSettings

Many objects have associated settings that can be retrieved and set. The updateSettings action is the same for each of them.

$data = array(
	"token" => $token,
	"tokenHash" => $tokenHash,
	"objectType" => "animalsAdoptions",
	"objectAction" => "updateSettings",
	"values" => array(
		array(
			"showAppPending" => "Yes",
		),
	),
);