• id: A unique UUID for the query
  • project_id: id of project containing public file to be read (required)
  • path: path to file to be read in target project (required)

Read a public (shared) text file in the project whose id is supplied. User does not need to be owner or collaborator in the target project and does not need to be logged into CoCalc. Argument path is relative to home directory in target project.

Security key may be blank.


Read a public file.

curl -u : \
  -d project_id=e49e86aa-192f-410b-8269-4b89fd934fba \
  -d path=Public/hello.txt
==> {"event":"public_text_file_contents",
     "data":"hello world\nToday is Friday\n"}

Attempt to read a file which is not public.

curl -u sk_abcdefQWERTY090900000000: \
  -d project_id=e49e86aa-192f-410b-8269-4b89fd934fba \
  -d path=Private/hello.txt
==> {"event":"error","id":"0288b7d0-dda9-4895-87ba-aa71929b2bfb",
     "error":"path 'Private/hello.txt' of project with id 'e49e86aa-192f-410b-8269-4b89fd934fba' is not public"}+

This information is based on 2460511947 exported at 2019-05-04T08:09:48.370Z.