Open nikclayton opened 1 year ago
Note re poll
-- it doesn't contain the full poll metadata, only the titles and the poll ID.
This is a translated poll where the original post had no content warning.
{
"detected_source_language": "fr",
"language": "en",
"provider": "DeepL.com",
"spoiler_text": "",
"content": "<p><span class=\"h-card\"><a href=\"https://mastodon.social/@nikclayton\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>nikclayton</span></a></span></p>",
"poll": {
"id": "649249",
"options": [
{
"title": "A"
},
{
"title": "Two"
},
{
"title": "Three"
},
{
"title": "Four"
}
]
},
"media_attachments": []
}
This is a translated status with a content warning, body text, and one image with a media description:
{
"detected_source_language": "fr",
"language": "en",
"provider": "DeepL.com",
"spoiler_text": "A test warning",
"content": "<p>A test station</p><p><span class=\"h-card\"><a href=\"https://mastodon.social/@nikclayton\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>nikclayton</span></a></span></p>",
"poll": null,
"media_attachments": [
{
"id": "111325487027294122",
"description": "A description of the test image"
}
]
}
The doc for Translation does list a spoiler_warning attribute which is not returned as far as I can tell. I believe that is supposed to be spoiler_text.
https://docs.joinmastodon.org/entities/Translation/ describes the following attributes in the response.
content
detected_source_language
provider
According to implementation on mastodon.social at the time of writing (4.1.3+nightly-20230706) there is also:
spoiler_text
language
(appears to be the language the text is translated into)poll
(untested, but I assume this is a https://docs.joinmastodon.org/entities/Poll/ withoptions[.title]
values translated)