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

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