POST api/listings/:id/enquiries
This action allows you to lodge an enquiry to the group responsible for a listing
Resource URL
| https://www.petrescue.com.au/api/listings/:id/enquiries |
POST Data
| Key | Description |
|---|---|
| enquiry required |
The content of the enquiry
Example Value:
|
| email required |
The email of whoever is making the enquiry
Requirement: Must be a valid email format (local-part@domain)
Example Value:
|
| name required | The name of whoever is making the enquiry |
| phone_number required | The phone number of whoever is making the enquiry |
Example Request
| POST | https://www.petrescue.com.au/api/listings/1/enquiries |
|---|---|
| POST data |
|
Successful Response
A successful request to this resource will return a status code of 200 OK. The response body will contain a JSON object with the contents of the enquiry.
For example, using the above example request the API would return the following data:
|
Error Response
An erroneous request to this resource will return a 400 Bad Request or 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. |
An example erroneous request where the parameters of the enquiry are omitted is:
| POST | https://www.petrescue.com.au/api/listings/1/enquiries |
|---|---|
| POST data |
null
|
The response status code will be 400 Bad Request and the response body from this request will be:
|
If the request POST data is fine but the Listing that matches the id provided is rehomed or removed, the response code will be a 404 Not Found and the response body will be:
|
If the request POST data is fine but the id provided doesn't match to a listing, the response code will be a 404 Not Found and the response body will be:
|