Projects
-
Update a project
PUT /api/1/projects/:id.jsonFormats
json jsonpUpdate an existing project. Requires a valid project object to be posted. Missing attributes from the object will be merged with the existing project.
Errors
- 401 Unauthorized
- 403 Read Denied - if the user is not allowed to update this project
- 404 Record Not Found - returned if the company with the specified UUID is not found
- 404 Record Not Found - returned if the project with the specified UUID is not found
- 422 Invalid Record - if the project fails validation. An error message will be returned, declaring the error.
Example
PUT /api/1/projects/7cadb71d-2eeb-4ee3-8067-fd35bb8b3512 { "project": { "name": "mollitia saepe", "company_uuid": "d0ad24cb-d74d-4cfe-bae9-4314bef82237", "visibility": "private" } } 200 { "response": { "active": "true", "company_uuid": "d0ad24cb-d74d-4cfe-bae9-4314bef82237", "default_tags": null, "hourly_rate": null, "hourly_rate_cents": null, "name": "mollitia saepe", "notes": null, "time_limit": null, "time_limit_string": null, "uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "visibility": "private", "activities": [ { "name": "dolores quidem", "project_uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "uuid": "9551368b-8bb2-4596-ab38-e313c68d0679" }, { "name": "est fugiat", "project_uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "uuid": "87107bdd-7c31-48a2-9ddf-6c2170ffe858" } ], "running": false, "grand_total": 0, "running_total": 0 } }Parameters
-
project
A project JSON object.
Required-
uuid
A UUID to identify the project. If null, one will be generated
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
name
Name of the project
Required Must be String -
active
Indicates if the project can be punched in to or not
Required Must be one of: true, false. -
company_uuid
UUID of the company the project belongs to
Required Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
visibility
Sets the visibility of the project. Public projects will be added to all staff; Private projects will only be available to the owner; Custom projects are only available to users in the user_uuids array
Optional Must be one of: public, private, custom. -
time_limit_string
String representation of the time limit. When saving, this value will be parsed and will populate time limit (if the supplied time limit is null)
Optional Must be String -
time_limit
Time limit for this project (in seconds)
Optional Must be Integer -
default_tags
An comma separated list of tags that will automatically applied to new running shifts when punching in
Optional Must be String -
notes
Notes associated with this project
Optional Must be String -
hourly_rate
String representation of the hourly rate. Will include currency symbol. When saving, this will be parsed and set hourly_rate_cents (if hourly_rate_cents is null)
Optional Must be String -
hourly_rate_cents
Hourly rate in cents.
Optional Must be Integer -
running
Is true if the project is currently running. Will be null if there is no time limit. This value is ignored when creating or updating a project.
Required Must be one of: true, false. -
grand_total
The number of seconds already punched in to this project by all users. If the project is punched in to, the grand_total will include time up until when the request is made
Optional Must be Integer -
running_total
The number of seconds already punched in to this project by just the authenticated user. If the project is punched in to, the running_total will include time up until when the request is made.
Required Must be Integer -
time_left
Returns the number of seconds lefts before the project becomes overdue. This value is ignored when creating or updating a project
Optional Must be Integer -
overdue
Is true if the project is overdue. Will be null if there is no time limit. This value is ignored when creating or update a project
Optional Must be one of: true, false. -
nearly_overdue
Is true if the project is nearly overdue. Will be null if there is no time limit. This value is ignored when creating or update a project
Optional Must be one of: true, false. -
started_at
The start time of the currently running shift. Will be null if the project is not running. This value is ignored when creating or update a project. Formatted as the number of seconds since EPOCH (in seconds).
Optional Must be Integer -
activities
Array of activity objects
Required Must be Array -
tag_list
An comma separated list of tags associated with the company
Optional Must be String -
invoice_amount
invoice_amount
Optional Must be String -
billable_by_default
billable_by_default
Optional Must be String
-
Update a project belonging to a company
PUT /api/1/companies/:company_uuid/projects/:uuid.jsonFormats
json jsonpUpdate an existing project. Requires a valid project object to be posted. Missing attributes from the object will be merged with the existing project.
Errors
- 401 Unauthorized
- 403 Read Denied - if the user is not allowed to update this project
- 404 Record Not Found - returned if the company with the specified UUID is not found
- 404 Record Not Found - returned if the project with the specified UUID is not found
- 422 Invalid Record - if the project fails validation. An error message will be returned, declaring the error.
Example
PUT /api/1/projects/7cadb71d-2eeb-4ee3-8067-fd35bb8b3512 { "project": { "name": "mollitia saepe", "company_uuid": "d0ad24cb-d74d-4cfe-bae9-4314bef82237", "visibility": "private" } } 200 { "response": { "active": "true", "company_uuid": "d0ad24cb-d74d-4cfe-bae9-4314bef82237", "default_tags": null, "hourly_rate": null, "hourly_rate_cents": null, "name": "mollitia saepe", "notes": null, "time_limit": null, "time_limit_string": null, "uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "visibility": "private", "activities": [ { "name": "dolores quidem", "project_uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "uuid": "9551368b-8bb2-4596-ab38-e313c68d0679" }, { "name": "est fugiat", "project_uuid": "7cadb71d-2eeb-4ee3-8067-fd35bb8b3512", "uuid": "87107bdd-7c31-48a2-9ddf-6c2170ffe858" } ], "running": false, "grand_total": 0, "running_total": 0 } }Parameters
-
project
A project JSON object.
Required-
uuid
A UUID to identify the project. If null, one will be generated
Optional Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
name
Name of the project
Required Must be String -
active
Indicates if the project can be punched in to or not
Required Must be one of: true, false. -
company_uuid
UUID of the company the project belongs to
Required Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -
visibility
Sets the visibility of the project. Public projects will be added to all staff; Private projects will only be available to the owner; Custom projects are only available to users in the user_uuids array
Optional Must be one of: public, private, custom. -
time_limit_string
String representation of the time limit. When saving, this value will be parsed and will populate time limit (if the supplied time limit is null)
Optional Must be String -
time_limit
Time limit for this project (in seconds)
Optional Must be Integer -
default_tags
An comma separated list of tags that will automatically applied to new running shifts when punching in
Optional Must be String -
notes
Notes associated with this project
Optional Must be String -
hourly_rate
String representation of the hourly rate. Will include currency symbol. When saving, this will be parsed and set hourly_rate_cents (if hourly_rate_cents is null)
Optional Must be String -
hourly_rate_cents
Hourly rate in cents.
Optional Must be Integer -
running
Is true if the project is currently running. Will be null if there is no time limit. This value is ignored when creating or updating a project.
Required Must be one of: true, false. -
grand_total
The number of seconds already punched in to this project by all users. If the project is punched in to, the grand_total will include time up until when the request is made
Optional Must be Integer -
running_total
The number of seconds already punched in to this project by just the authenticated user. If the project is punched in to, the running_total will include time up until when the request is made.
Required Must be Integer -
time_left
Returns the number of seconds lefts before the project becomes overdue. This value is ignored when creating or updating a project
Optional Must be Integer -
overdue
Is true if the project is overdue. Will be null if there is no time limit. This value is ignored when creating or update a project
Optional Must be one of: true, false. -
nearly_overdue
Is true if the project is nearly overdue. Will be null if there is no time limit. This value is ignored when creating or update a project
Optional Must be one of: true, false. -
started_at
The start time of the currently running shift. Will be null if the project is not running. This value is ignored when creating or update a project. Formatted as the number of seconds since EPOCH (in seconds).
Optional Must be Integer -
activities
Array of activity objects
Required Must be Array -
tag_list
An comma separated list of tags associated with the company
Optional Must be String -
invoice_amount
invoice_amount
Optional Must be String -
billable_by_default
billable_by_default
Optional Must be String
-