Searches the question bank: a need in, ranked questions out.
const url = 'https://app.jadwigo.pl/api/v1/question-searches';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"words":"example","words_en":"example","skills":["example"],"mistakes":["example"],"can_do":"example","contexts":["example"],"curriculum_tags":["example"],"resemble":"example","language":"pl","grade":"example","limit":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.jadwigo.pl/api/v1/question-searches \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "words": "example", "words_en": "example", "skills": [ "example" ], "mistakes": [ "example" ], "can_do": "example", "contexts": [ "example" ], "curriculum_tags": [ "example" ], "resemble": "example", "language": "pl", "grade": "example", "limit": 1 }'Called with the bank’s shared read token, not a Supabase token.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A search need, from jadwigo-bank schemas/need.schema.json at commit 703b679. It carries at least one of words, skills, can_do or resemble.
object
The need in plain words, in the caller’s language
English terms for the keyword arm when the need is not in English; never stored on a page
E.g. pl-2017:II.3.3, ccss:3.OA.C.7
A task to resemble, e.g. a homework problem’s text
Canonical form: the bare number, e.g. “3”
Responses
Section titled “Responses”OK.
A bank search’s answer, version 1, from jadwigo-bank schemas/search-envelope.schema.json at commit 703b679.
object
A search need, from jadwigo-bank schemas/need.schema.json at commit 703b679. It carries at least one of words, skills, can_do or resemble.
object
The need in plain words, in the caller’s language
English terms for the keyword arm when the need is not in English; never stored on a page
E.g. pl-2017:II.3.3, ccss:3.OA.C.7
A task to resemble, e.g. a homework problem’s text
Canonical form: the bare number, e.g. “3”
The arm that answered (A, A1, B, B1, C, C2)
Server-side stage times in milliseconds
object
Sha256 of the index manifest the service answered from; the publisher writes it with the rows, so a caller can tell which build of the bank a row came from
object
The index view the vector hit came from: title, samples, meaning_pl, meaning_en, needs
object
By language code: pl, en
object
Where the set’s questions come from: khan, own, ai
The attribution line the product must show: Khan Academy, CC BY-NC-SA 4.0 and the exercise’s URL
The set’s enrichment fields the caller may show, each the set page’s value: summary and can_do by language, mistake_classes as records, contexts as word lists by language; any other key, a private body among them, is dropped on parse
object
By language code: pl, en
object
By language code: pl, en
object
object
How the mistake shows in one answer
By language code: pl, en
object
Sha256 of the set page the row was built from
Shas of the pictures the set’s questions need
How many questions the set holds (the bank’s field name)
A private body never crosses this route
A private body never crosses this route
One row per known arm: the asked arm’s outcome and not_asked for the rest
object
What degraded it (an embedder or reranker failure), never a key or a URL with a token
Example
{ "version": 1, "need": { "language": "pl" }, "stage": "first", "cache": "hit", "state": [ { "state": "ok" } ]}An error: {error: {type, message}}. The type names the cause, and answers with one status:
- 400:
BadRequest,ServerFieldSupplied - 401:
NotSignedIn,Unauthorized - 404:
NotFound - 409:
AccountMissing,AttemptClaimed,AttemptPreview,AssignmentClosed,AttemptFinished,AttemptNotFinished,AttemptPaused,QuestionNotOpen,TryOutOfOrder,AnswerConflict,EventIdMismatch,WriteOnce - 429:
AnswerLimit - 502:
BankUnavailable
object
object
Example
{ "error": { "type": "BadRequest" }}An error: {error: {type, message}}. The type names the cause, and answers with one status:
- 400:
BadRequest,ServerFieldSupplied - 401:
NotSignedIn,Unauthorized - 404:
NotFound - 409:
AccountMissing,AttemptClaimed,AttemptPreview,AssignmentClosed,AttemptFinished,AttemptNotFinished,AttemptPaused,QuestionNotOpen,TryOutOfOrder,AnswerConflict,EventIdMismatch,WriteOnce - 429:
AnswerLimit - 502:
BankUnavailable
object
object
Example
{ "error": { "type": "BadRequest" }}An error: {error: {type, message}}. The type names the cause, and answers with one status:
- 400:
BadRequest,ServerFieldSupplied - 401:
NotSignedIn,Unauthorized - 404:
NotFound - 409:
AccountMissing,AttemptClaimed,AttemptPreview,AssignmentClosed,AttemptFinished,AttemptNotFinished,AttemptPaused,QuestionNotOpen,TryOutOfOrder,AnswerConflict,EventIdMismatch,WriteOnce - 429:
AnswerLimit - 502:
BankUnavailable
object
object
Example
{ "error": { "type": "BadRequest" }}