Skip to content

Endpoints to retrieve and update a TranscriptionEntity

https://redmine.teklia.com/issues/12055

A single APIView should be added at /api/v1/transcription-entity/{id}/ to allow retrieving or updating a TranscriptionEntity, through RetrieveTranscriptionEntity, UpdateTranscriptionEntity and PartialUpdateTranscriptionEntity.

All three endpoints will require guest access on the corpus, or should raise HTTP 404. When updating, an HTTP 403 is raised when the user has guest but not contributor access on the corpus. If the TranscriptionEntity has a WorkerRun set, an HTTP 403 is raised if the user does not have admin access to the corpus. This matches the rules for other ML results.

All three endpoints should use the new drf_standardized_errors error format.

RetrieveTranscriptionEntity outputs the exact same attributes as a single result of ListTranscriptionEntities or as the response of CreateTranscriptionEntity.

It should be possible to update the type_id, offset, length and confidence of a TranscriptionEntity, but not the worker_run. Updates should perform the same validation as the existing creation endpoints, checking that the TranscriptionEntity does not overflow the transcription's text and that the unique constraint is still respected.