This API is designed to fetch the Capex Request DISBURSEMENT TIMELINE and can be accessed through web browsers, native applications on Android, and iOS.
URL :
http://<server-ip-address>/custom_api/export_capex_details/capex_disbursement_spend_timeline
Method : GET
| URL Parameters | Required | Value |
|---|---|---|
| Content Type Format | Yes | json or form-data |
| data_from_timestamp | Yes | Capex_id |
| URL Data Parameters | No | |
| data_from_timestamp | Yes | 1 |
| capex_id | Yes | 1 |
| current_page | Yes | 1 |
| Example | Yes | ?capex_id=1&data_from_timestamp=1¤t_page=1 |
Header Parameters:
Authorization :
Bearer <Token>
Success Response :
Code : 200
Content :
{
"code": 200,
"message": "success",
"data": {
"number_of_results": "4897",
"number_of_pages": 245,
"results_per_page": 20,
"current_page": "1",
"entity_name": "capex_request_disbursement_spend_timeline",
"resultset": [
{
"timeline_type": {
"label": "Monthly",
"value": "Monthly"
},
"year": {
"label": "Year",
"value": "2021"
},
"amount": {
"label": "Amount",
"value": "54516.00"
},
"month_or_qtr": {
"label": "Month or Quarter",
"value": "08"
},
"capex_id": {
"label": "Capex Id",
"value": "11252"
},
"id": {
"label": "Id",
"value": "4202"
},
"currency": {
"label": "Currency",
"value": "$"
}
}
}
Error Response :
- Code: 401 BAD REQUEST
- Content:
{
"code": 401,
"message": "fail",
"data": {
"error": "Invalid API Token"
}
}
Note : The success response may change in the future if required.
Code Examples :
JavaScript Code (Fetch API) :
fetch("http://<server-ip-address>/custom_api/export_capex_details/capex_disbursement_spend_timeline?capex_id=1&data_from_timestamp=1¤t_page=1", {
method: "GET",
headers: {
"Authorization": "Bearer <Token>"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.log("Error:", error));
PHP Code :
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://<server-ip-address>/custom_api/export_capex_details/capex_disbursement_spend_timeline?capex_id=1&data_from_timestamp=1¤t_page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer <Token>"
),
));
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if ($error) {
echo "cURL Error: $error";
} else {
echo $response;
}
cURL Command :
curl -H "Authorization: Bearer <Token>" -X GET "http://<server-ip-address>/custom_api/export_capex_details/capex_disbursement_spend_timeline?capex_id=1&data_from_timestamp=1¤t_page=1"
Final Answer :
This documentation provides a detailed overview and examples for the DISBURSEMENT TIMELINE API, describing its URL, methods, parameters, and responses. Code examples are provided in JavaScript, PHP, and cURL for easy implementation.