First, we GET the test case in question using the following call:

GET: projects/{project_id}/test-cases/{test_case_id}

This returns a full object for the test case. If there is a an automated script attached, the "AutomationAttachmentId" field is returned (otherwise it is null).

With this id we can the GET the contents of the test script file with the following call:

GET: projects/{project_id}/documents/{document_id}/open