Skip to main content

Submit crew sheets

POST 

/api/v1/crew_sheets/submit

Submit one or more of another user's sheets for approval, on their behalf. This is the action behind the Submit button on the Crew Entry screen.

Not a RESTful endpoint

This endpoint does not necessarily follow the standard REST conventions. In particular, it uses the POST method for operations that would typically use GET, PUT or DELETE in a RESTful API endpoint.

The request body is a JSON array of sheets. Each is submitted in its own transaction, so a problem with one sheet does not prevent the others going through.

Check the response body, not just the status code

A partial failure, and even a total failure, still returns HTTP 200. Inspect success and the errors array to find out what actually happened. See the response schema for details.

A sheet can be named either by its id_sheet, or by id_user plus sheet_date when the user has no sheet for the period yet, in which case the sheet is created and then submitted.

Required abilities

You must hold at least one of Authority - Timekeeper, Authority - Expensekeeper, or Authority - Custom Entry keeper, or be an administrator.

Request​

Responses​

The outcome of the submit request. The results object is always empty; the outcome is reported in status and errors.

A partial failure still returns HTTP 200. Treat a non-empty errors array, or success being false, as the signal that at least one sheet did not submit. Each failed sheet contributes one message, prefixed with the user_name and sheettype_label you supplied.