API reference
Conversation context
Let visitors refine a search ("anything online?", "only next month") without repeating themselves.
How it works
- Send the first question with no
context. - Store the
contextstring from the response against the visitor (session, transient or cookie on your server). - Send the visitor's next message with that
context. The API keeps the earlier topic and filters and applies the change. - Replace the stored value with the new response's
contexteach time.
curl https://oms-api.mainconsulting.co.uk/api/public/v1/search \
-H "Authorization: Bearer $OMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "I need first aid training for my staff."}'Rules
- The token is signed. Don't edit it. Altered or expired tokens return
400 invalid_context; start again withcontext: null. - It expires after 2 hours.
- It holds only search parameters (topic, location, dates, budget), never personal details. OMS keeps no server-side session.
- To start a fresh search (e.g. a "New search" button), send
context: null.
Keep one context per visitor. Never share one visitor's token with another.