Send an enquiry to a business
POST/api/v1/public/enquiry_forms/{key}
Creates an enquiry in the business's workspace and emails the business. Any website may post here, from a script (the answer carries Access-Control-Allow-Origin: *), a plain HTML form or a form plugin's webhook. Send the fields flat, as multipart (with photos), URL-encoded or JSON. Use https: a plain-http post is redirected and lost. Field names are read loosely: your-name, full_name or first_name with last_name; tel or mobile; comments or your-message; postcode or zip. Any other field is kept in the message as "Label: value", and fields starting with _ are ignored. Only a post with nothing in it is refused. Up to 5 JPEG, PNG, WebP or HEIC photos of 10 MB each are kept; others are left out and the message says so. A browser form post (Accept: text/html) is answered 303 to _redirect when that is on the posting site, otherwise to the hosted thank-you page. Everything else is answered 201. A filled _gotcha (leave it hidden and empty) is answered 201 and nothing is stored. The same enquiry sent again within 10 minutes is answered 201 without a second record, so no Idempotency-Key is needed. Limited to 10 posts per 15 minutes from one address and 100 enquiries in any 24 hours per business; a 429 says how long the limit lasts in Retry-After. A refusal is the usual JSON error. The one exception is a plain HTML form, whose Accept has text/html and no JSON type: its visitor is shown a small HTML page that says what went wrong and to go back and try again, with the same status and headers.
- Needs no key. Anyone may send it, from a web page or a server.
Parameters
In the address
keystringrequiredThe workspace's form key, from `account.enquiry_form.key`. It is not a secret.
At least 1 character.
Request body
Sent as multipart/form-data, or as application/x-www-form-urlencoded or application/json.
namestringemailstringphonestringaddress_line_1stringcitystringpostal_codestringmessagestring_pagestring_redirectstring_gotchastringphotos[]array of string (binary)Up to 5 items.
Responses
201The enquiry was received.
dataobjectrequiredFields(1)
receivedbooleanrequired
303A browser form post is sent on to _redirect, or to the hosted thank-you page.
No body.
A refusal answers in the one error shape every operation shares.
Example
A request our own tests send. The ids are made up: put your own in their place.
curl -X POST "https://app.tradesender.co.uk/api/v1/public/enquiry_forms/YOUR_FORM_KEY" \ -F "your-name=Jane Smith" \ -F "email=jane.smith@example.test" \ -F "tel=01632 960123" \ -F "address=3 Mill Lane" \ -F "town=Douglas" \ -F "postcode=IM1 1AA" \ -F "message=The hedge needs cutting back." \ -F "Garden size=Large" \ -F "photos[]=@photo.jpg"