Documentation

POST /api/ask

Ask a question against one or more catalog products.

RequestPOST /api/ask
AuthenticationSession cookie required
Handlerbackend/server.py

What it does

A question answered from the catalog evidence for the named products. With no question the engine abstains by name rather than guessing.

Authentication

Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.

Parameters

ParameterInTypeRequiredDescription
ff_sessioncookiestringOptionalThe session identifier. Omit it on the first call and store the value the response sets; every later call must send the same one or the engine treats the caller as a new visitor with no holds and no claims.
qbodystringRequiredThe question. Empty input is refused as `no_question`.
product_idsbodystring[]OptionalProducts to answer against. Defaults to the session's own resolution.

Request

The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"q":"<string>","product_ids":"<string[]>"}' \
  "https://flowfinds.ai/api/ask"
const res = await fetch("https://flowfinds.ai/api/ask", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "q": "<string>",
    "product_ids": "<string[]>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/ask", json={
    "q": "<string>",
    "product_ids": "<string[]>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"q":"…","product_ids":["…"]}' \
  "$FLOWFINDS_ORIGIN/api/ask"

Responses

200The question was answered, or abstained on by name.

Errors

StatusReasonWhen
400The body is not JSON.

Related

Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.