I'm trying to insert a YouTube player on the page. I use the API telegra.ph/api. Tell me, please, where is my error?
https://api.telegra.ph/createPage?access_token=b968da509bb76866c35425099bc0989a5ec3b32997d55286c657e6994bbb&title=Sample+Page&author_name=Anonymous&content=[{"tag":"p","children":["Hello,+world!"]},{"tag":"figure","children":[{"tag":"iframe","attrs":[{"src":"https://www.youtube.com/embed/J5iXWsmZQeM"}]},{"tag":"figcaption","children":["https://i.ytimg.com/vi/1cO-ZcQJCP4/hqdefault.jpg"]}]}]&return_content=true
Here is an example:
so, the part after /embed/youtube?url= should be used with encodeURIComponent function . Also, figure tag is mandataory as I understand
Answer was inspired from here: https://github.com/python273/telegraph/issues/5