Skip to content

Tickets

Creating Tickets

URL Path: /secured/filesystem/tickets

HTTP Method: POST

Error Codes: ERR_NOT_A_USER, ERR_DOES_NOT_EXIST, ERR_NOT_WRITEABLE

Request Parameters:

  • public - Tells terrain whether to make the ticket accessible to the public group. Setting it to 1 means that the ticket will be made publicly accessible. Any other value means that the ticket will not be accessible publicly. This parameter is optional and defaults to not making tickets public.

Request Body:

{
    "paths" : [
        "/path/to/file/or/directory",
        "/path/to/another/file/or/directory"
    ]
}

Response Body:

{
    "user" : "<username>",
    "tickets" : [
        {
            "path"              : "/path/to/file/or/directory",
            "ticket-id"         : "<ticket-id>",
            "download-url"      : "http://127.0.0.1:8080/d/<ticket-id>",
            "download-page-url" : "http://127.0.0.1:8080/<ticket-id>"
        }
    ]
}

Curl Command:

curl -H "$AUTH_HEADER" -d '{"paths":"/path/to/file/or/directory","/path/to/another/file/or/directory"]}' 'http://127.0.0.1:3000/secured/filesystem/tickets?public=1'

Listing Tickets

URL Path: /secured/filesystem/list-tickets

HTTP Method: POST

Error Codes: ERR_NOT_A_USER, ERR_DOES_NOT_EXIST, ERR_NOT_WRITEABLE

Request Parameters:

Request Body:

{
    "paths" : ["list of paths to look up tickets for"]
}

Response Body:

{
    "tickets" : {
        "/path/to/file" : [
            {
                "path"              : "/path/to/file",
                "ticket-id"         : "<ticket-id>",
                "download-url"      : "http://127.0.0.1:8080/d/<ticket-id>",
                "download-page-url" : "http://127.0.0.1:8080/<ticket-id>"
            }
        ],
        "/path/to/dir"  : [
            {
                "path"              : "/path/to/dir",
                "ticket-id"         : "<ticket-id>",
                "download-url"      : "http://127.0.0.1:8080/d/<ticket-id>",
                "download-page-url" : "http://127.0.0.1:8080/<ticket-id>"
            }
        ]
    }
}

Curl Command:

curl -H "$AUTH_HEADER" -d '{"paths":["/path/to/file","/path/to/dir"]}' http://127.0.0.1:3000/secured/filesystem/list-tickets

Deleting Tickets

URL Path: /secured/filesystem/delete-tickets

HTTP Method: POST

Error Codes: ERR_NOT_A_USER, ERR_DOES_NOT_EXIST, ERR_NOT_WRITEABLE

Request Parameters:

Request Body:

{
    "tickets" : ["ticket-id1", "ticket-id2"]
}

Response Body:

{
    "tickets" : ["ticket-id1", "ticket-id2"]
}

Curl Command:

curl -H "$AUTH_HEADER" -d '{"tickets":["ticket-id1","ticket-id2"]}' http://127.0.0.1:4000/secured/filesystem/delete-tickets