Budget
Estimated reading: 3 minutes
Description :
Use this API to get Capex Request for Budget Management from various sources (Web Browser, Native application in Android, iOS).
URL :
http:///custom_api/export_capex_details/budgets
Method : GET
Data Parameters | Required | Value |
---|---|---|
json or form-data | Yes | |
capex_id | Yes | 1 |
current_page | Yes | 1 |
Example | Yes | ?capex_id=1¤t_page=1 |
Header Parameters:
Authorization :
Bearer <Token>
Success Response :
Code : 200
Content :
{
"code": 200,
"message": "success",
"data": {
"number_of_results": 3446,
"number_of_pages": 173,
"results_per_page": 20,
"current_page": "1",
"entity_name": "budget_line_item_details",
"resultset": [
{
"budget_status": {
"label": "Budget Status",
"value": ""
},
"calfield_15": {
"label": "Project Score",
"value": ""
},
"capex_type": {
"label": "Category",
"value": "standalone"
},
"expense_type": {
"label": "Subcategory",
"value": "Capital Expenditure"
},
"budget_owner_user_id": {
"label": "Budget Owner",
"value": ""
},
"budget_wbs_element": {
"label": "Budget WBS Element",
"value": "Softwares"
},
"budget_wbs_number": {
"label": "Budget WBS Number",
"value": "2.20"
},
"capex_request_type_asset_category_id": {
"label": "Asset Category Description",
"value": null
},
"capex_request_type_asset_category_sub_category_id": {
"label": "Asset Equipment Description",
"value": null
},
"name_of_expense": {
"label": "Name of Expense",
"value": "Hypar BIM - BIM design and engineering for UK (global platform)"
},
"priority": {
"label": "Engineering Category",
"value": ""
},
"project_end": {
"label": "Anticipated Project End",
"value": ""
},
"project_manager_user_id": {
"label": "Project Manager",
"value": "Craig Norman - Segment Manager Building Services"
},
"reason": {
"label": "Capex Driver",
"value": "DIG"
},
"request_number": {
"label": "Request number",
"value": "GB040-HU-2023-31"
},
"sub_number": {
"label": "Temp Number",
"value": "GB040_9026"
},
"business_unit": {
"label": "Entity",
"value": "21119"
},
"detailed_path_business_unit": {
"label": "Entity (detailed path)",
"value": ""
},
"currency": {
"label": "Currency",
"value": "GBP"
},
"years": {
"2023_1": {
"label": "2023 Jan",
"value": 23000
},
"2023_2": {
"label": "2023 Feb",
"value": 0
},
"2023_3": {
"label": "2023 Mar",
"value": null
},
"2023_4": {
"label": "2023 Apr",
"value": null
},
"2023_5": {
"label": "2023 May",
"value": null
},
"2023_6": {
"label": "2023 Jun",
"value": null
},
"2023_7": {
"label": "2023 Jul",
"value": null
},
"2023_8": {
"label": "2023 Aug",
"value": null
},
"2023_9": {
"label": "2023 Sep",
"value": null
},
"2023_10": {
"label": "2023 Oct",
"value": null
},
"2023_11": {
"label": "2023 Nov",
"value": null
},
"2023_12": {
"label": "2023 Dec",
"value": null
}
}
}
]
}
}
Error Response :
- Code: 401 BAD REQUEST
Content :
{
"code": 401,
"message": "fail",
"data": {
"error": "Invalid API Token"
}
}
Note :
Success response may change in the future if required.
PHP Code :
PHP:$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http:///custom_api/export_capex_details/budgets?capex_id=1¤t_page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer '
),
));
$response = curl_exec($curl);
$data = json_decode($response);
if ($data->code === 200) {
// Handle success response
} else {
// Handle error response
}
curl_close($curl);
JavaScript Code (using Fetch) :
fetch('http:///custom_api/export_capex_details/budgets?capex_id=1¤t_page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer '
}
})
.then(response => response.json())
.then(data => {
if (data.code === 200) {
// Handle success response
} else {
// Handle error response
}
});
curl Cammand :
curl -X GET "http:///custom_api/export_capex_details/budgets?capex_id=1¤t_page=1" \
-H "Authorization: Bearer "
This documentation includes all the required details for the Budget Management’s Budget API, as well as code examples for PHP, JavaScript, and cURL. If there are any other details or changes needed, please let me know!