Link WBS Element to Capex Request

Estimated reading: 3 minutes

Link WBS Element to Capex Request :

This part details how to use the endpoint for linking WBS elements to capex requests. You will find the description, URL, method, parameters, and examples for this endpoint. The code examples are provided in PHP, JavaScript, and Curl for making HTTP requests.

Link Actual to Capex Request

 This part describes the endpoint for linking the actual amount to capex requests. You will find the description, URL, method, parameters, and examples for this endpoint. The code examples are also provided in PHP, JavaScript, and Curl for making HTTP requests.

Description :

Use this API to link WBS element to capex request from anywhere (Web Browser, Native application in android, iOS)

URL :

				
					http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_wbs
				
			
Method : POST
URL Parameters Required
Json or form-data
Yes

Form Data Parameters:

KeyValue
Capexplan Request NumberIM-number (Request-Number)
Work Breakdown Structure ElementWBS Element
Project TitleShort description
Project DefinitionProject Definition

Example :

				
					{
    "CapexplanRequestNumber":"BUA-7000-34",
    "WorkBreakdownStructureElement":"123456789",
    "ProjectTitle":"Test",
    "ProjectDefinition":"Test"
}

				
			
Header Parameters:

Authorization :

Bearer <Token>

Success Response :

Code: 200

Content :

				
					{
    "code": 200,
    "message": "success",
    "data": []
}

				
			

Error Response :

Code: 401 BAD REQUEST

Content :

				
					{
    "code": 401,
    "message": "fail",
    "data": {
        "error": "Invalid API Token"
    }
}

				
			

OR

				
					{
    "code": 400,
    "message": "fail",
    "data": {
        "[WorkBreakdownStructureElement]": "This 123456789 WBS Element already associated with this BUA-2020-4165 capex request!"
    }
}

				
			

OR

				
					{
    "code": 400,
    "message": "fail",
    "data": {
        "[CapexplanRequestNumber]": [
            "This field is missing."
        ]
    }
}


				
			

OR

				
					{
    "code": 400,
    "message": "fail",
    "data": {
        "[CapexplanRequestNumber]": [
            "This field is missing."
        ],
        "[WorkBreakdownStructureElement]": [
            "This field is missing."
        ]
    }
}

				
			
Note :

Link WBS Element to Capex Request :

PHP Code :
				
					$url = "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_wbs";
$headers = array('Authorization: Bearer <Token>');
$data = array(
    "CapexplanRequestNumber" => "BUA-7000-34",
    "WorkBreakdownStructureElement" => "123456789",
    "ProjectTitle" => "Test",
    "ProjectDefinition" => "Test"
);
$options = array(
    'http' => array(
        'header'  => $headers,
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);
$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);

				
			
Javascript Code :
				
					var url = "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_wbs";
var xhr = new XMLHttpRequest();
xhr.open("POST", url);
xhr.setRequestHeader("Authorization", "Bearer <Token>");
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.send(JSON.stringify({
    "CapexplanRequestNumber": "BUA-7000-34",
    "WorkBreakdownStructureElement": "123456789",
    "ProjectTitle": "Test",
    "ProjectDefinition": "Test"
}));

				
			
cURL :

curl -X POST :

				
					curl -X POST "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_wbs" \
     -H "Authorization: Bearer <Token>" \
     -H "Content-Type: application/json" \
     -d '{
        "CapexplanRequestNumber": "BUA-7000-34",
        "WorkBreakdownStructureElement": "123456789",
        "ProjectTitle": "Test",
        "ProjectDefinition": "Test"
     }'

				
			
Link Actual to Capex Request :
PHP Code :
				
					$url = "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_actual";
$headers = array('Authorization: Bearer <Token>');
$data = array(
    // Your JSON Data Here
);
$options = array(
    'http' => array(
        'header'  => $headers,
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);
$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);

				
			
Javascript Code :
				
					var url = "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_actual";
var xhr = new XMLHttpRequest();
xhr.open("POST", url);
xhr.setRequestHeader("Authorization", "Bearer <Token>");
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.send(JSON.stringify({
    // Your JSON Data Here
}));

				
			
cURL :

curl code :

				
					curl -X POST "http://<server-ip-address>/custom_api/sap_to_cap_ex_plan/link_actual" \
     -H "Authorization: Bearer <Token>" \
     -H "Content-Type: application/json" \
     -d '{
        // Your JSON Data Here
     }'

				
			
Share this Doc

Link WBS Element to Capex Request

Or copy link

CONTENTS