Create another preview entry on a comment, in the same revision as the preview preview_file_id. A comment can have several previews in the same revision. The route creates the metadata only. Upload the file after, with the preview file upload route. Administrators and the managers of the project can use this route. Other users must be assignees of the task, supervisors of its department, or creators of its entity. A client of the project cannot use this route.
POST
/actions/tasks/{task_id}/comments/{comment_id}/preview-files/{preview_file_id}
curl
curl -X POST "http://api.example.com/actions/tasks/a24a6ea4-ce75-4665-a070-57453082c25/comments/a24a6ea4-ce75-4665-a070-57453082c25/preview-files/a24a6ea4-ce75-4665-a070-57453082c25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
import requests
url = "http://api.example.com/actions/tasks/a24a6ea4-ce75-4665-a070-57453082c25/comments/a24a6ea4-ce75-4665-a070-57453082c25/preview-files/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
params = {}
payload = None
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Response examples (201)
{
"id": "b24a6ea4-ce75-4665-a070-57453082c250",
"comment_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"task_id": "c24a6ea4-ce75-4665-a070-57453082c250",
"revision": 2,
"person_id": "d24a6ea4-ce75-4665-a070-57453082c250"
}