OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/docs/api/apiv3/endpoints/budgets.apib

148 lines
4.9 KiB

Feature/remove timelog (#8557) * rename costs, introduce budgets * move files from costs to budgets * rename cost_object to budget * remove unused code * move hook - should be turned into standard code in the long run * move type attributes change over to budgets * move patch to work_package proper * move budget menu item up * combine reporting, time and cost module * remove rails based time_entries & reports code * rename cost object filter * adapt menu spec expectations * use cost project module name in administration * include timeline labels in migration * properly place budget linking method * fix permitted params * remove outdated routing spec * adapt budget request specs * ensure order of descendent updates * remove outdated specs * fix checking for reporting to be enabled * fix displaying spent units * fix time entries activity event url * reenable current rate tab * fix path on budget page * allow bulk editing of budgets only in one project scenario * fix sanitizing reference in controller * include module required for format_date * fix reference to correct units from work package spent units * linting * remove outdated spec * remove outdated views and permission references * remove acts_as_event from time_entries There is no atom link for time entries * remove acts_as_event from projects There are no atom links for projects * introduce budget filter for cost reports * remove actions added to removed controller * move time entries to the costs module * factor in view_own permission when calculating time entry visibility * linting * move mounting of time entries * include budgets into api v3 documentation
4 years ago
# Group Budgets
*Note: Budgets are currently only implemented as a stub. Further properties of budgets might be added at a future date, however they will require the view budget permission to be displayed.*
## Linked Properties:
| Link | Description | Type | Constraints | Supported operations |
|:---------:|-------------------------------------------- | ------------- | --------------------- | -------------------- |
| self | This budget | Budget | not null | READ |
## Properties
| Property | Description | Type | Constraints | Supported operations | Condition |
| :---------: | ------------------------------------------- | ----------- | ----------- | -------------------- | --------------------------- |
| id | Budget id | Integer | x > 0 | READ | |
| subject | Budget name | String | not empty | READ | |
## Budget [/api/v3/budgets/{id}]
+ Model
+ Body
{
"_type" : "Budget",
"_links" : {
"self" : {
"href" : "/api/v3/budgets/1",
"title" : "Q3 2015"
}
},
"id" : 1,
"subject" : "Q3 2015"
}
## view Budget [GET]
+ Parameters
+ id (required, integer, `1`) ... Budget id
+ Response 200 (application/hal+json)
[Budget][]
+ Response 403 (application/hal+json)
Returned if the client does not have sufficient permissions.
**Required permission:** view work packages **or** view budgets (on the budgets project)
+ Body
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
"message": "You are not allowed to see this budget."
}
## Budgets by Project [/api/v3/projects/{id}/budgets]
+ Model
+ Body
{
"_links" : {
"self" : {
"href" : "/api/v3/projects/1/budgets"
}
},
"_type" : "Collection",
"total" : 2,
"count" : 2,
"_embedded" : {
"elements" : [
{
"_type" : "Budget",
"_links" : {
"self" : {
"href" : "/api/v3/budgets/1",
"title" : "Q3 2015"
}
},
"id" : 1,
"subject" : "Q3 2015"
},
{
"_type" : "Budget",
"_links" : {
"self" : {
"href" : "/api/v3/budgets/2",
"title" : "Q4 2015"
}
},
"id" : 2,
"subject" : "Q4 2015"
}
]
}
}
## view Budgets of a Project [GET]
+ Parameters
+ id (required, integer, `1`) ... Project id
+ Response 200 (application/hal+json)
[Budgets by Project][]
+ Response 403 (application/hal+json)
Returned if the client does not have sufficient permissions to see the budgets of the given
project.
**Required permission:** view work packages **or** view budgets
*Note that you will only receive this error, if you are at least allowed to see the corresponding project.*
+ Body
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:MissingPermission",
"message": "You are not allowed to see the budgets of this project."
}
+ Response 404 (application/hal+json)
Returned if either:
* the project does not exist
* the client does not have sufficient permissions to see the project
* the costs module is not enabled on the given project
**Required permission:** view project
*Note: A client without sufficient permissions shall not be able to test for the existence of a project.
That's why a 404 is returned here, even if a 403 might be more appropriate.*
+ Body
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
"message": "The specified project does not exist."
}