OMSCourse Search API
API reference

Conversation context

Let visitors refine a search ("anything online?", "only next month") without repeating themselves.

How it works

  1. Send the first question with no context.
  2. Store the context string from the response against the visitor (session, transient or cookie on your server).
  3. Send the visitor's next message with that context. The API keeps the earlier topic and filters and applies the change.
  4. Replace the stored value with the new response's context each 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 with context: 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.