Request Type Management

This API allows you to retrieve Capex Request Types from various platforms such as web browsers, native applications in Android, and iOS.

API URL:

http://<server-ip-addres>/custom_api/capex_type

Method: GET

URL Parameters:

URL ParametersRequired
format=json (In future, Maybe change to default)Yes
OptionalNone

Form Data Parameters:

None

Header Parameters:

Authorization:

Bearer <Token> (Replace <Token> with the actual access token)

Success Response:

Code: 200

Content:

{
  "code": 200,
  "message": "success",
  "data": {
    "standalone": "Standalone Capex",
    "project": "Project",
    "envelope": "Envelope",
    "other": "Other",
    "Test Satish": "Test Satish"
  }
}

Error Response:

Code: 401 BAD REQUEST

Content:

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

Notes: The structure of the success response may change in the future if required.

Code Examples:

cURL Example:

curl -X GET "http://<server-ip-address>/custom_api/capex_type?format=json" -H "

Authorization:

Bearer <Token>"

PHP Code:

<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'http://<server-ip-address>/custom_api/capex_type?format=json',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <Token>'
  )
));

$response = curl_exec($curl);
curl_close($curl);

echo $response;
?>

JavaScript code:

const url = 'http://<server-ip-address>/custom_api/capex_type?format=json';
const token = '<Token>';

fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error(error));

Note: Replace with the actual IP address of the server and with the valid access token.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top