Speech Challenges

Guide the student in speaking through an optional topic and optional reference audio.

List all speech challenges

URL

GET /challenges/speech HTTP/1.1

Request

GET /challenges/speech HTTP/1.1
Accept: application/json

Response

The response is a JSON list with speech challenges.

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": "speech_1",
    "created": "2014-01-28T21:25:10Z",
    "updated": "2014-01-28T21:25:10Z",
    "topic": "What do you know about babies?",
    "language": "eng",
    "referenceAudioUrl": "https://api.itslanguage.io/download/YsjdG37bUGseu8-bsJ",
    "srtUrl": "https://api.itslanguage.io/download/UKbsMpBsXaJUsBbK",
    "imageUrl": "https://api.itslanguage.io/download/GdExSbs-ZVNnQUUe",
    "metadata": null
  },
  {
    "id": "12",
    "created": "2014-01-28T21:25:10Z",
    "updated": "2014-01-28T21:25:10Z",
    "language": "eng",
    "topic": "Book",
    "referenceAudioUrl": null,
    "srtUrl": null,
    "imageUrl": null,
    "metadata": null
  }
]

Get a single speech challenge

URL

GET /challenges/speech/:challenge HTTP/1.1
  • challenge - Required The speech challenge identifier.

Request

GET /challenges/speech/speech_1 HTTP/1.1
Accept: application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": "speech_1",
  "created": "2014-01-28T21:25:10Z",
  "updated": "2014-01-28T21:25:10Z",
  "topic": "What do you know about babies?",
  "language": "eng",
  "referenceAudioUrl": "https://api.itslanguage.io/download/YsjdG37bUGseu8-bsJ",
  "srtUrl": "https://api.itslanguage.io/download/zVXLJJuGyhBHQbfX",
  "imageUrl": "https://api.itslanguage.io/download/dlnBo-dotLpnhN-a",
  "metadata": null
}

Create a speech challenge

URL

POST /challenges/speech HTTP/1.1

Request parameters

Name Type Description
id string Optional The speech challenge identifier. If none is given, one is generated.
topic string Optional A question or topic serving as guidance to the student.
language string Required Language of the challenge in ISO 639-2 format.
referenceAudio blob Optional The reference audio fragment.
srt blob Optional The transcription of the challenge in .srt format.
image blob Optional An image to show with the challenge.
metadata string Optional Client specific properties that are not validated nor filtered.

Request

POST /challenges/speech HTTP/1.1
Accept: application/json
Content-Type: multipart/form-data; boundary=jhgd87g7Gy3d78

--jhgd87g7Gy3d78
Content-Disposition: form-data; name="referenceAudio"; filename="blob"
Content-Type: audio/ogg

<blob>
--jhgd87g7Gy3d78
Content-Disposition: form-data; name="topic"

What do you know about babies?
--jhgd87g7Gy3d78
Content-Disposition: form-data; name="language"

eng
--jhgd87g7Gy3d78
Content-Disposition: form-data; name="srt"; filename="chal.srt"
Content-Type: text/plain

<blob>
--jhgd87g7Gy3d78
Content-Disposition: form-data; name="image"; filename="img.png"
Content-Type: image/png

<blob>
--jhgd87g7Gy3d78--

Response

HTTP/1.1 201 Created
Content-Type: application/json
Location: https://api.itslanguage.io/challenges/speech/4

{
  "id": "4",
  "created": "2014-01-28T21:25:10Z",
  "updated": "2014-01-28T21:25:10Z",
  "topic": "What do you know about babies?",
  "language": "eng",
  "referenceAudioUrl": "https://api.itslanguage.io/download/YsjdG37bUGseu8-bsJ",
  "srtUrl": "https://api.itslanguage.io/download/QEYduwrFRHeufiru",
  "imageUrl": "https://api.itslanguage.io/download/h-JJREJRCFAeA-nl",
  "metadata": null
}

Update a speech challenge

URL

PUT /challenges/speech/:challenge HTTP/1.1
  • challenge - Required The speech challenge identifier.

Update one or more properties of an existing speech challenge.

Request parameters

Name Type Description
topic string Required A question or topic serving as guidance to the student.
language string Required Language of the challenge in ISO 639-2 format.
referenceAudio blob Optional The reference audio fragment.
srt blob Optional The transcription of the challenge in .srt format.
image blob Optional An image to show with the challenge.

Request

PUT /challenges/speech/4 HTTP/1.1
Accept: application/json
Content-Type: application/json

{
  "topic": "What do you know about the baby?"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json
Location: https://api.itslanguage.io/challenges/speech/4

{
  "id": "4",
  "created": "2014-01-28T21:25:10Z",
  "updated": "2014-01-28T21:25:10Z",
  "topic": "What do you know about the baby?",
  "language": "eng",
  "referenceAudioUrl": "https://api.itslanguage.io/download/cxtczOCmVbvVsIFw",
  "srtUrl": "https://api.itslanguage.io/download/acfRSlgOorYdeYcP",
  "imageUrl": "https://api.itslanguage.io/download/xCbFikceYVgUIHqc",
  "metadata": null
}