# Create Enquiry

Create an enquiry from the Agent Response API. This is useful for when you want to start the process of form requests from a custom integration, such as your company website or CRM.

WARNING

Successful enquiries count towards your monthly credits. Please contact us if you expect to run a lot of tests.

# Endpoint

  • /enquiries - POST

# Required Params

  • api_token - String: Your API token
  • office_id - Integer
  • email - String: The lead email address - must be a valid email address.
  • enquiry_type - String: Must be Letting, Sale, Valuation, or General.

# Optional Params

  • portal - String: The portal to register the enquiry against - see supported portals below
  • name - String: The lead's name
  • telephone - String: The lead telephone number
  • message - String: A message, usually from the lead, with additional information such as a general query.
  • property_address - String: The property address related to the enquiry.

# Supported Portals

By default the enquiry will be registered as an API enquiry. You can override this with one of the following options:

  • Right Move
  • Zoopla
  • On The Market
  • One Dome
  • Residential People
  • House Ladder

TIP

To use a portal and enquiry type together the Estate Agent must have the combination set up in their Agent Response Office.

# Example Request

  • cURL
  • PHP
  • Ruby
## Create Enquiry
curl -X "POST" "https://app.agentresponse.co.uk/api/enquiries?api_token=YOUR_API_TOKEN" \
	 -H 'Content-Type: application/json' \
	 -H 'Accept: application/json' \
	 -d $'{
  "email": "f.bloggs@example.org",
  "message": "Hello! Can I keep a cat at this residence?",
  "office_id": "8",
  "enquiry_type": "Letting",
  "name": "Fred Bloggs",
  "property_address": "123 Fake Street",
  "telephone": "01234 567891"
}'

# Example Response

  • HTTP Status Code - 201
{
  "name": "Fred Bloggs",
  "email": "f.bloggs@example.org",
  "telephone": "01234 567891",
  "enquiry_type": "Letting",
  "property_address": "123 Fake Street",
  "message": "Hello! Can I keep a cat at this residence?"
}

# Example Failed Responses

# Invalid data

The data sent to Agent Response will be validated before sending enquiries. The following validation rules apply:

  • email - required and must be a valid email address.

  • enquiry_type - required and must be Letting, Sale, Valuation, or General.

  • office_id - required and must be an office id that you have authorization to use.

  • HTTP Status Code - 422

{
  "message": "The given data was invalid.",
  "errors": {
	"email": [
	  "The email must be a valid email address."
	],
	"enquiry_type": [
	  "The enquiry type field is required."
	]
  }
}

# No portal found

If you try to submit an enquiry for an enquiry type that does not exist for your specified office you will receive this error.

To fix it, first log into your Agent Response account, select the office and create an 'API' portal with enquiry type(s) of your choosing.

  • HTTP Status Code - 404
{
  "message": "Equiry type not found for portal 'API'. Make sure that your office has API portals setup."
}