Create a test
const url = 'https://api-language-test.lernexa.com/api/v1/tests';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Ana Torres","email":"ana.torres@example.com","language":"French","interfaceLanguage":"Spanish","chineseScript":"simplified","skills":["Use of language","Reading","Listening"],"externalId":"006Qy00000A1b2CIAR-S1","sendEmail":false}'};
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://api-language-test.lernexa.com/api/v1/tests \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Ana Torres", "email": "ana.torres@example.com", "language": "French", "interfaceLanguage": "Spanish", "chineseScript": "simplified", "skills": [ "Use of language", "Reading", "Listening" ], "externalId": "006Qy00000A1b2CIAR-S1", "sendEmail": false }'Creates a test for a candidate and, unless sendEmail is false, emails them its link. Safe to repeat with an externalId: a second request with it returns the first test, as it is now. At most 1,000 tests an hour per key.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”A test to create. A field not listed here is refused.
object
The candidate’s name.
The candidate’s email address. Their results go there when they finish.
The language tested, by its English name, in any case: English, French, German, Spanish, Italian, Portuguese, Swedish, Mandarin, Japanese, Greek, Arabic, Dutch.
The candidate’s own language, for the screens and emails, by its English name. Left out or empty: English.
For a Mandarin test, its characters. Left out or empty: simplified.
The sections, as an array or as text separated by commas. Use of language is always tested. Left out or empty: your school’s defaults.
Your own id for this sitting, sent back with the result. A second request with it returns the test the first created.
Responses
Section titled “Responses”A test with this externalId already exists: it is returned as it is now, and the request’s other fields are ignored.
A test, with its result once completed.
object
Your own id for the sitting, if you gave one.
The language tested.
The candidate’s own language.
The sections the test covers.
Invited until the candidate starts, in progress until every section is done, then completed.
The test’s page in the staff app.
What a completed test found, and what staff decided.
object
The level to record, at most 20 characters: the placement, else the overall level, else “Not enough evidence”.
Each section the test covered, with its level.
Example
{ "language": "English", "interfaceLanguage": "English", "skills": [ "Use of language" ], "status": "invited", "result": { "overall": { "level": "A1", "band": "Low", "text": "B1 High" }, "placement": { "level": "A1", "band": "Low", "text": "B1 High" }, "levelText": "B1 High", "sections": [ { "skill": "Use of language", "level": { "level": "A1", "band": "Low", "text": "B1 High" } } ] }}Created.
A test, with its result once completed.
object
Your own id for the sitting, if you gave one.
The language tested.
The candidate’s own language.
The sections the test covers.
Invited until the candidate starts, in progress until every section is done, then completed.
The test’s page in the staff app.
What a completed test found, and what staff decided.
object
The level to record, at most 20 characters: the placement, else the overall level, else “Not enough evidence”.
Each section the test covered, with its level.
Example
{ "language": "English", "interfaceLanguage": "English", "skills": [ "Use of language" ], "status": "invited", "result": { "overall": { "level": "A1", "band": "Low", "text": "B1 High" }, "placement": { "level": "A1", "band": "Low", "text": "B1 High" }, "levelText": "B1 High", "sections": [ { "skill": "Use of language", "level": { "level": "A1", "band": "Low", "text": "B1 High" } } ] }}Not JSON, a field missing or wrong, or a field not listed. The sentence names them.
object
What went wrong, in a sentence.
Example generated
{ "error": "example"}No key, an unknown key or a revoked key.
object
What went wrong, in a sentence.
Example generated
{ "error": "example"}A language the test does not cover, or not yet. The sentence names it.
object
What went wrong, in a sentence.
Example generated
{ "error": "example"}Too many requests: 600 a minute per key, 1,200 a minute from one address. Wait a minute.
object
What went wrong, in a sentence.
Example generated
{ "error": "example"}