application/controllers/Api.php
/**
	 * Get all equipment type items
	 * GET /api/equipmenttype?api_key=2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP/1.1
	 *
	 * Get a single checklist item by $id
	 * GET /api/equipmenttype/11?api_key=2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP/1.1
	 */
Get all equipment type items
GET /api/equipmenttype?api_key=2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP/1.1

Get a single checklist item by $id
GET /api/equipmenttype/11?api_key=2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP/1.1
Get all equipment type items GET / api / equipmenttype?api_key = 2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP / 1 . 1 Get a single checklist item by $id GET / api / equipmenttype / 11?api_key = 2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP / 1 . 1
public function equipmenttype_get($id = null) {
		$apiKey = $_REQUEST['api_key'];
		$this->load->model('Equipmenttype_model');
		if(is_null($id)) {
			$equipmenttypes = $this->Equipmenttype_model->findAll();
		} else {
			$equipmenttypes = $this->Equipmenttype_model->findOne($id);
		}
		if($apiKey==API_KEY) {
			$this->response([
				'status' => TRUE,
				'message' => 'OK',
				'equipmenttypes' => $equipmenttypes,
				'count' => count($equipmenttypes)
			], REST_Controller::HTTP_OK);
		} else {
			$this->response([
				'status' => FALSE,
				'message' => 'Invalid credentials. Please try again.'
			], REST_Controller::HTTP_UNAUTHORIZED);
		}
	}
public function equipmenttype_get ( $ id = null ) { $ apiKey = $ _REQUEST [ 'api_key' ] ; $ this -> load -> model ( 'Equipmenttype_model' ) ; if ( is_null ( $ id ) ) { $ equipmenttypes = $ this -> Equipmenttype_model -> findAll ( ) ; } else { $ equipmenttypes = $ this -> Equipmenttype_model -> findOne ( $ id ) ; } if ( $ apiKey == API_KEY ) { $ this -> response ( [ 'status' => TRUE , 'message' => 'OK' , 'equipmenttypes' => $ equipmenttypes , 'count' => count ( $ equipmenttypes ) ] , REST_Controller :: HTTP_OK ) ; } else { $ this -> response ( [ 'status' => FALSE , 'message' => 'Invalid credentials. Please try again.' ] , REST_Controller :: HTTP_UNAUTHORIZED ) ; } }
Get all equipment type items
 GET /api/equipmenttype?api_key=2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP/1.1
Get all equipment type items GET / api / equipmenttype?api_key = 2b3vCKJO901LmncHfUREw8bxzsi3293101kLMNDhf HTTP / 1 . 1