Examples
Action getPublicableStatuses
Retrieve the list of animal statuses that can be made public.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "getPublicableStatuses",
); |
Action getPublicStatuses
Retrieve the list of animal statuses that are currently public.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "getPublicStatuses",
); |
Action setPublicStatuses
Set the animal statuses that should be public. The array of statuses must include all statuses that you want to be public.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "setPublicStatuses",
"values" => array(
array(
"statuslist" => array("1"),
),
),
); |
Action publicSearch
Get the first 10 adoptable dogs, sorted by animalID ascending.
Code Block |
---|
|
$data = array(
"apikey" => $publicApiKey,
"objectType" => "animals",
"objectAction" => "publicSearch",
"search" => array (
"resultStart" => 0,
"resultLimit" => 10,
"resultSort" => "animalID",
"resultOrder" => "asc",
"calcFoundRows" => "Yes",
"filters" => array(
array(
"fieldName" => "animalStatus",
"operation" => "equal",
"criteria" => "Available",
),
array(
"fieldName" => "animalSpecies",
"operation" => "equal",
"criteria" => "Dog",
),
),
"fields" => array("animalName"),
),
); |
Get the first 10 small available/adoptable animals ordered by animalID ascending.
Code Block |
---|
|
$data = array(
"apikey" => $publicApiKey,
"objectType" => "animals",
"objectAction" => "publicSearch",
"search" => array (
"resultStart" => 0,
"resultLimit" => 10,
"resultSort" => "animalID",
"resultOrder" => "asc",
"filters" => array(
array(
"fieldName" => "animalStatus",
"operation" => "equal",
"criteria" => "Available",
),
array(
"fieldName" => "animalGeneralSizePotential",
"operation" => "equal",
"criteria" => "Small",
),
),
"fields" => array("animalID", "animalOrgID", "animalName", "animalBreed"),
),
); |
Action getDisabledFields
Retrieve the list of currently disabled animal fields.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "getDisabledFields",
); |
Action setDisabledFields
Set the field animalAdoptedDate to disabled. All other fields will be enabled.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "setDisabledFields",
"values" => array(
array(
"fieldlist" => array("animalAdoptedDate"),
),
),
); |
Action setRequiredFields
Set the field animalAdoptedDate to required. All other fields will not be required (other than those required by the system).
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "setRequiredFields",
"values" => array(
array(
"fieldlist" => array("animalAdoptedDate"),
),
),
); |
Action add
Add an animal
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "add",
"values" => array(
array(
"animalName" => "testing",
"animalSpeciesID" => "Cat",
"animalPrimaryBreedID" => "1",
"animalSecondaryBreedID" => "2",
"animalStatusID" => "1",
"animalDescription" => "This is the description of this cat!",
),
),
); |
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "add",
"values" => array(
array(
"animalName" => "Testing",
"animalSpeciesID" => "Cat",
"animalPrimaryBreedID" => "1",
"animalSecondaryBreedID" => "17",
"animalStatusID" => "1",
"animalFound" => "No",
),
),
); |
Action edit
Edit an animal.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "edit",
"values" => array(
array(
"animalID" => $validPK,
"animalName" => "edited testing first name",
"animalSpeciesID" => "Dog",
"animalPrimaryBreedID" => "419",
"animalSecondaryBreedID" => "421",
"animalStatusID" => "2",
"animalFound" => "No",
),
),
); |
Change an animal's animal groups.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "edit",
"values" => array(
array(
"animalID" => "1",
"animalGroups" => array("0" => "1", "1" => "85"),
),
),
); |
Action videos
Retrieve the list of videos associated with a specific animal. In this case we are actually getting the videos for two animals at the same time.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => "animals",
"objectAction" => "videos",
"values" => array (
"0" => array(
"animalID" => 1,
),
"1" => array(
"animalID" => 2,
),
),
); |
Action videoUrls
Retrieve the list of video URLs (YouTube videos) associated with a specific animal.
Code Block |
---|
|
$data = array(
"token" => $token,
"tokenHash" => $tokenHash,
"objectType" => x,
"objectAction" => "youtubeUrls",
"values" => array (
"0" => array(
"animalID" => 1,
),
),
); |