GET api/listings
This search allows you to find a paginated collection of Listings based on criteria provided in the request.
Resource URL
| https://www.petrescue.com.au/api/listings |
Parameters
There are no required parameters.
If no parameters are passed to the search then the first 50 active Listings will be returned.
| Key | Description |
|---|---|
| age |
The age of the pet.
If Omitted: All ages are shown.
Requirement:
Either Requirement: Must also provide the species parameter. The combination of species and date of birth of a pet determines its age. |
| coat |
The coat length of the pet.
If Omitted: All coats are shown.
Requirement:
Any of
Requirement:
species must be one of
Example Value:
|
| foster_needed |
If Omitted:
Both
Requirement:
Either |
| gender |
The gender of the pet.
If Omitted: All genders are shown.
Requirement:
Either |
| group_id | Comma delimited list of group id's the pet was listed by. Note that your api token may have limitations on group id's that can be searched. |
| interstate |
Include pets that can be moved interstate.
If Omitted:
Both
Requirement:
Either
Requirement:
states parameter must be provided. The interstate parameter is meaningless if no state is specified. That is, if you provide |
| multiple_animals |
Includes listings that have multiple pets.
If Omitted:
Both
Requirement:
Either |
| page |
The page of results you want to see.
If Omitted:
Both Requirement: Must be greater than 0. |
| per_page |
The number of listings you want to see per page.
If Omitted:
Requirement: Must be greater than 0 and less than or equal to 50. |
| postcode | An Australian postcode. |
| postcode_range |
The range in kilometres from the postcode provided to search in.
If Omitted:
Requirement:
Requirement: Must have the postcode parameter set. |
| senior |
Include senior pets.
If Omitted:
Both
Requirement:
Either |
| species |
The name of the species you'd like to search for.
If Omitted: All species are shown.
Example Values:
|
| breed |
The name of the breed you'd like to search for. Search multiple breeds by separating with commas.
If Omitted: All breeds are shown.
Example Values:
|
| exclude_species |
A comma separated list of species to exclude from the search.
If Omitted: All species are shown.
Example Value:
|
| size |
The size of the pet when it is full grown.
If Omitted: All sizes are shown.
Requirement:
Any of
Example Value:
|
| states |
The Australian states to search for pets in.
If Omitted: All states are shown.
Requirement:
A comma-seperated string of abbreviations. One of:
Example Value:
|
| status |
The status of the pet listings to be searched.
If Omitted:
Requirement:
Example Value:
|
Example Request
| GET |
https://www.petrescue.com.au/api/listings?states=WA,NSW&interstate=true&gender=male
|
|---|
Successful Response
A successful request to this resource will return a 200 OK. The response body will contain a JSON object with details of the search.
| Field | Value |
|---|---|
| listings | An array of objects that each represent a single Listing. |
| page | A string representing the current page of search results being shown. |
| per_page | A string representing the number of Listings shown per page of search results. |
| total_pages | A string representing the total number of pages available for these search results. |
The fields that are returned for a Listing are:
| Field | Type | Value |
|---|---|---|
| adoption_fee | String | The fee for adopting the pet. |
| adoption_process | String | The process for adopting the pet. |
| breeds | Array of Strings |
Each breed for the pet.
Example Value:
|
| breeds_display | String |
A string representation of the breed of the pet. Example: Border Collie x Kelpie for a cross. If the pet is a mixed breed, mix will be suffixed on to the end.
Example Value:
|
| coat | String |
The coat length of the pet. One of Short, Medium, Long. coat will only be returned for Cats and Guinea Pigs. For other species null will be returned.
|
| coat_colour | String |
The coat color of the pet (e.g., "Black", "White and Brown", "Tricolour"). Returns null if no color data is available.
|
| contact_number | String | The contact phone number of the listing. |
| contact_preferred_method | String |
The preferred contact method of the group. One of Email or Phone.
|
| created_at | String |
The date the listing was created. Formatted as: %-d/%-m/%Y %-H:%M.
Example Value:
|
| date_of_birth | String |
The date of birth of the pet. Formatted as: %-d/%-m/%Y. Returns null if there is no available date of birth data for the Listing.
Example Value:
|
| desexed | Boolean | Whether the pet is desexed (true) or not (false). |
| foster_needed | Boolean | Whether the pet requires foster care (true) or not (false). |
| gender | String | One of Male or Female. |
| group | String | The name of the Rescue Group. |
| heart_worm_treated | String | Whether the pet has been heart worm treated (Yes) or not (No), or it is not known (Unsure). heart_worm_tested will only be returned for Dogs. For other species null will be returned. |
| id | Integer | The id of the listing. |
| interstate | Boolean | Whether or not the pet can be adopted interstate. |
| last_updated | String |
The the listing was last updated. Formatted as %-d/%-m/%Y %-H:%M.
Example Value:
|
| medical_notes | String | The medical notes for a listing. |
| microchip_number | String | The microchip number for the listing. |
| mix | Boolean | Whether the listing is a mixed breed (true) or not (false). |
| multiple_animals | Boolean | Whether the listing contains multiple animals (true) or not (false). |
| name | String | The name of the pet. |
| personality | String | A description of the personality of the pet. |
| photos | Array |
An array of objects containing URLs to different sized photos (served as compressed jpgs) of the listing. Each object is formatted as:
Each jpg is square, with padded whitespace to fill the shorter side of the image.
|
| senior | Boolean | Whether the listing is a senior animal (true) or not (false). |
| size | String |
The size of the pet. One of Small, Medium or Large. size will only return for Dogs. For other species null will be returned.
|
| species | String |
The name of the species of the pet.
Example Value:
|
| state | String |
An abbreviation of the Australian state the pet is in.
Example Value:
|
| vaccinated | String | Whether the pet has been vaccinated (Yes) or not (No), or it is not known (Unsure). vaccinated will only be returned for Cats, Dogs and Rabbits. For other species null will be returned. |
| wormed | String | Whether the pet has been wormed (Yes) or not (No), or it is not known (Unsure). wormed will only be returned for Cats and Dogs. For other species null will be returned. |
Error Response
An erroneous request to this resource will return a 400 Bad Request. The response body will contain a JSON object with details of the error.
The error object will contain:
| Key | Description |
| error_code | A string describing the error. |
|---|---|
| errors | A JSON object containing all of the errors in from request. |
An example erroneous request is:
| GET | https://www.petrescue.com.au/api/listings?age=adult&senior=f&gender=male |
|---|
The response body from this request would be:
|