Add a block to a lesson
const url = 'https://api.passion.io/v1/apps/example/lessons/example/blocks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"block":{"kind":"text","markdown":"example"},"position":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://api.passion.io/v1/apps/example/lessons/example/blocks \ --header 'Content-Type: application/json' \ --data '{ "block": { "kind": "text", "markdown": "example" }, "position": 1 }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the App, as Studio shows it.
The id of a lesson, as get_course or create_lesson answers it.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Text that the member reads.
object
The text in Markdown: headings, lists, bold, italic and links.
One uploaded image.
object
The id of a file that create_upload answered, after the file is uploaded.
One uploaded video. Give fileId or url, not both.
object
The id of a file that create_upload answered, after the file is uploaded.
One video from YouTube or Vimeo. Give fileId or url, not both.
object
A YouTube or Vimeo link.
One uploaded audio track.
object
The id of a file that create_upload answered, after the file is uploaded.
Files that members download, for example PDFs. Its files cannot be changed later.
object
The uploaded files, in the order members see them.
Questions and answers. Members open a question to read its answer.
object
Each item has a question and its answer, in the order members see them.
object
A button that opens a web page.
object
The label of the button.
The page the button opens.
Where the block goes: 0 puts it first. Leave it out to put the block last.
Responses
Section titled “Responses”OK
object
Example
{ "kind": "text"}