GET api/listings/:id
This search will allow you to get information on a specific Listing in the PetRescue system.
Resource URL
| https://www.petrescue.com.au/api/listings/:id |
Parameters
| id required |
The numerical ID of the PetRescue Listing
Example Value:
Requirement: The id must map to an active Listing |
|---|
Example Request
| GET |
https://www.petrescue.com.au/api/listings/117
|
|---|
Successful Response
A successful request to this resource will return a 200 OK. The response body will contain a JSON representation of the Listing that matches the provided id.
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 404 Not Found. 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. |
If the Listing that matches the provided id is removed or rehomed the response status code will be a 404 Not Found and the response body will be:
|
If the provided id doesn't actually map to any Listing the response status code will be a 404 Not Found and the response body will be:
|