Find an answer for a question
GET
/api/answers/match
const url = 'http://127.0.0.1:8765/api/answers/match?question_id=example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://127.0.0.1:8765/api/answers/match?question_id=example'The answer closest to one question, when it is close enough to suggest. Model-free: word overlap between the question and each answer (ids and question words). match is null when nothing scores 0.5 or when this exact id is already answered (that is plain reuse). To use the suggestion, save it as the answer: POST /api/answers {question_id, answer, from_bank: match.bank_question_id}. Assess responses, GET /api/jobs and a run’s /results and /posting carry the same suggestions as bank_suggestions.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”question_id
required
string
The new question’s id.
question
string
The new question’s words.
Responses
Section titled “Responses”Success.
Media typeapplication/json
object
schema_version
required
key
additional properties
any
Example
{ "match": { "answer": "Yes, 4 years, GKE + BigQuery", "bank_question": "Do you have GCP experience?", "bank_question_id": "cloud:gcp", "question_id": "tooling:cloud_google_platform", "score": 1 }, "question_id": "tooling:google_cloud_platform", "schema_version": "scout-answers-response:1"}Forbidden / forbidden_origin: loopback peer and Host 127.0.0.1:<port> or localhost:<port> only (Origin too on writes).
Media typeapplication/json
object
error
required
object
allowed_keys
Array<string>
code
required
string
message
required
string
key
additional properties
any
Examplegenerated
{ "error": { "allowed_keys": [ "example" ], "code": "example", "message": "example" }}Target_unavailable
Media typeapplication/json
object
error
required
object
allowed_keys
Array<string>
code
required
string
message
required
string
key
additional properties
any
Example
{ "error": { "code": "target_unavailable", "message": "..." }}Unknown_key, invalid_value
Media typeapplication/json
object
error
required
object
allowed_keys
Array<string>
code
required
string
message
required
string
key
additional properties
any
Example
{ "error": { "code": "unknown_key", "message": "..." }}