Using files from Yandex.Disk

If your tasks require images or other files, upload them to Yandex.Disk . You can only use files from Yandex.Disk if it is linked to the same account you are using in Toloka.

To use files on Yandex.Disk in tasks:
  1. Add links to files in the task.

Connecting to Yandex.Disk

To use Yandex.Disk as a data source:

  1. Click Add Ya.Disk on the profile page (the External Services Integration tab) and allow Toloka access to Yandex.Disk.

  2. Click Add proxy and fill in the fields:

    Field

    Description

    Unique name

    Name of the data source. The name will be inserted in the file URLs. Allowed characters in the name: Latin letters, numbers, dashes (“-”).

    Must be unique within Toloka.

    Type

    Choose “Yandex.Disk”.

    Permissions

    Level of access to files:

    • “Public” — All Toloka performers (appropriate for files with instructions).

    • “Private” — Only performers who received a task with this file (appropriate for task content).

    Folder name

    The name of the folder on Yandex.Disk. You can't use a slash (“/”) in the folder name.

    A folder with this name will be created on Yandex.Disk automatically (Applications/Yandex.Toloka/<folder name>).

  3. Click Save.

The Applications/Yandex.Cleanup/<folder name> folder will be created on Yandex.Disk (the name you entered in the URL field). Upload images or other files for tasks to it.

Adding files from Yandex.Disk

Upload files for your tasks to Yandex.Disk and add them to the project:

Project instructions

To add an image to the project instructions:

  1. Click the button on the toolbar.
  2. Insert /api/proxy/<unique name of your proxy>/<name of the file you want to add> in the field that appears. For example: /api/proxy/yadisk/image1.jpg.
  3. Press Enter.
Task interface

To add a file such as an image or an audio clip in the task interface:

  1. Set the string data type for the input data field in which you will pass the file link.

  2. Insert the file using the proxy <input data field name> expression:
    Add:
    • The{{img src=(proxy image)}} component.
    • The <img src={{proxy image}}> HTML tag.
  3. Include relative links to the Yandex.Disk files in the TSV file with tasks. The link format should be <unique name of your proxy>/<path to and name of the file you want to add>. For example: yadisk/image1.jpg or yadisk/photos/image1.png. Note that the folder name is not always required. Sometimes it's enough to specify the proxy name and file name separated by a slash ("/").

Example

Let's say you create a task that shows the performer a photo and asks them to rate it.

Connect Yandex.Disk
  1. Open the Integration with external services page and click Add proxy.
  2. Fill in the fields:
    • Unique name: yadisk
    • Type: Yandex.Disk
    • Access rights: Public
    • Folder name: pics
  3. Click Save.
Set up a project
  1. Open the template list.
  2. Choose the Image classification template.
  3. Change the input field type from image to string.
  4. Change the component in the HTML block to {{img src=(proxy image)}}.
  5. Open the External Services Integration page in a new tab and copy the /yadisk/example.jpg link.
  6. Go back to project creation and click Preview.
  7. Click Change input data.
  8. Replace Text from the image field with the copied link.
  9. Click Apply. The first task will display the picture.
    Task view with a picture
  10. Save the project.
Upload files
Upload files to the Applications/Yandex.Toloka/yadisk folder in the web interface or using the Yandex.Disk app.
Use links
  1. In the project instructions, use links like /api/proxy/<unique name of your proxy>/<name of the file you want to add>.
  2. Include relative links <unique name>/image1.jpg in the INPUT field in the TSV file Then upload tasks to the pool.
  3. Click Preview in the pool and make sure that the files are available in the task.

    If the files are unavailable, make sure they are in the Applications/Yandex.Toloka/yadisk folder and try refreshing the token on the External Services Integration page.