This article applies to using annotation tools, regardless of whether SDA has been set up for your team or not.
Output Columns
The output column in annotation tool contains json objects containing the URLs as well as a few metadata fields. Below is an example of the updated output:
{"type":"audio_transcription","valueRef":"jobs/1756256/annotations/
1bc9311e-1205-46bf-8afd-c005e28b70d1.json",
"url":"https://requestor-proxy.appen.com/v1/redeem_token?token=xMHOg2A/
K+hcG1lRO4aZ2mmRwJIoV0q3ZgEJUAdq2N8jghbJ8KHelkcIZQlY9IIOa2QNW5KZaqkh6dAVzq0rt0z8
5ywsvloTiIEpAN3ax/GR0yGPmgPzU53ouQksaG+seXH9PPoLA21ilUXPhWgMQ7O6wHpJ4YxFQhB74XZCdQqzb
Krl2iaPQsSfE3Ahuo1fbhGwFKPRDq9nru8vq3Qalc5x1AuHg10qW5JPh6MJtGOcY04L1iaoDN6QPprRDCt47u+I
++lgm6ils6Kt2oILrSzWbOyw6BVwK7vIqPVkW0A3CYyAj/hHgOi4v+0qPTU735xPROo0GvSfg6p6XQ==--kwDu
0HkOgyfCMytE--tgLpI/Z3NS/na2RWdB1LNg==&version=297"
}
Authentication to Access URLs
URLs in the report require authentication.
See example below if you have scripts that operate on the output URLs:
To call - replace your requestor proxy hostname to api-gateway:
https://requestor-proxy.appen.com/v1/redeem_token?token=gSz/nU4ULsQjpetkA5l5V1ZXgt04exB
EVr2DsgiqIsyvAd1QvnkiG9MQVhQXgGZmEpSS1E0EJd17QB4DNju1w8js45FOZq2xiV8zPdmKkgdjphrDRl3E8
topXMp0PydXUkV32zre1HJnp4dN0M8ZyDu5V+hlVJ2wbuz83qh3+raRWU510imK53HVn/RTlplqld4lDdlWeR8a
Mljf/88RQpvuFhJk6ckixhZclOSi21Iq5POEn1xeJKcxzjY4TzCpQvFQYEGsKS4VEq+J9eVUxvDRUHoZxDRwv02
Nc9Jg/ggbXEH7sxXPnA6zf3RVYlb8ZQ==--s5tHd/9d1AG1dASD--FtLuDsqPS8pa2CH7/p66Bg==&version=
285
to this, and add the api key at the end:
https://api-beta.appen.com/v1/redeem_token?token=gSz/nU4ULsQjpetkA5l5V1ZXgt04exBEVr2Ds
giqIsyvAd1QvnkiG9MQVhQXgGZmEpSS1E0EJd17QB4DNju1w8js45FOZq2xiV8zPdmKkgdjphrDRl3E8topXMp
0PydXUkV32zre1HJnp4dN0M8ZyDu5V+hlVJ2wbuz83qh3+raRWU510imK53HVn/RTlplqld4lDdlWeR8aMljf/8
8RQpvuFhJk6ckixhZclOSi21Iq5POEn1xeJKcxzjY4TzCpQvFQYEGsKS4VEq+J9eVUxvDRUHoZxDRwv02Nc9Jg/
ggbXEH7sxXPnA6zf3RVYlb8ZQ==--s5tHd/9d1AG1dASD--FtLuDsqPS8pa2CH7/p66Bg==&version=285&key=
YOUR_API_KEY
Using ref-to-url to translate CDS refs into URLs
If units are stored in CDS but job design requires a URL, you can use a liquid filter to translate the CDS reference into a URL. The structure {{ data_column | ref_to_url }} will turn a CDS ref from data_column into a short-lived S3 link. In addition, you can use the /link endpoint in CDS to generate short-lived S3 links.
Example:
Unit data
script,audio_file
"Hey Siri, what time is it?", ""{ "type":"file_upload",
"valueRef":"/jobs/123456/annotations/00112233-4455-6677-8899-aabbccddeeff00.wav"
}""
CML code
<audio src="{{ audio_file | ref_to_url }}" />
HTML on the assignment page
<audio src="https://s3.amazon.com/cds/teams/00112233-4455-6677-8899-aabbccddeeff00/
jobs/123456/annotations/00112233-4455-6677-8899-aabbccddeeff00.wav?sig=xyz" />