Budgets - Edit a budget period

API Url

Use it to edit a budget period

PUT
http://localhost:16010/ProMarkREST/web/System/Budgets/{id}/periods/{periodId}

Permissions: user

Request headers

FieldTypeDescription
Accept-LanguageoptionalString

=en-GB Language use for localization.

X-ClientoptionalString

=Client type.

Allowed values:"Portal""Mobile""Admin"
X-RoleoptionalNumber

ProMark role (1: Employee, 2: User).

Allowed values:{12}
X-WebPart-IdoptionalNumber

Unique web-part identifier.

Path parameters

FieldTypeDescription
idNumber

Budget id.

periodIdNumber

Budget period id.

Query parameters

FieldTypeDescription
contextIdoptionalString

Context id

contextTypeoptionalNumber

Context type 1: Department 2: Group 3: Approval group

fromoptionalDate

Start date for the budget periods

tooptionalDate

End date for the budget periods

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    budgetPeriodsObject[]
      budgetIdString

The budget ID for which the period is created

      budgetValueNumber

The budget value.

      contextIdString

The parent id of the budget.

      contextTypeNumber

The parent type of the budget. 1: Department 2: Group 3: Approval group

      fromDate

Start date of the new period

      periodDaysObject[]

Array with information about the days in the period.

        calculatedValueNumber

The calculated value for the day.

        dayDate

Date of a day in period

        factorNumber

Factor of the day

      rotationLengthNumber

The length of the period.

Request example:

{
"request": {
"data": {
"budgetPeriods": [
{
"budgetId": "123",
"from": "2020-05-12",
"rotationLength": 7,
"budgetValue": 2000,
"contextType": 1,
"contextId": "Dept1",
"periodDays": [{
"periodId": 44452,
"day": "2020-05-12",
"factor": 1,
"calculatedValue": 100,
"actualValue": 200
},
{
"periodId": 44452,
"day": "2020-05-13",
"factor": 1,
"calculatedValue": 200
},
{
"periodId": 4452,
"day": "2020-05-14",
"factor": 1,
"calculatedValue": 200
},
{
"periodId": 44452,
"day": "2020-05-15",
"factor": 1,
"calculatedValue": 200
},
{
"periodId": 44452,
"day": "2020-05-16",
"factor": 2,
"calculatedValue": 400
},
{
"periodId": 44452,
"day": "2020-05-17",
"factor": 2,
"calculatedValue": 400
},
{
"periodId": 44452,
"day": "2020-05-18",
"factor": 2,
"calculatedValue": 400
}]
}
]
}
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.