Ejemplo n.º 1
0
});
// GET Request for all employees pertaining to a restaurant
$app->get('/merchant/:id/employees/', function ($id) use($app) {
    // check for required params
    $request = array();
    $response = array();
    $apiKey = array();
    $headers = $app->request->headers->all();
    verifyHeaders(array('Key'));
    // reading request params
    $apiKey = $headers['Key'];
    $request['apiKey'] = $apiKey;
    $request['restaurantID'] = $id;
    $controller = new ApiController();
    // Call controller function
    $response = $controller->getEmp($request);
    // echo json response
    echoRespnse(200, $response);
});
// GET Request pertaining to restaurant and employee id
$app->get('/merchant/:id/employee/:id2', function ($id, $id2) use($app) {
    // check for required params
    $request = array();
    $response = array();
    $apiKey = array();
    $headers = $app->request->headers->all();
    verifyHeaders(array('Key'));
    // reading request params
    $apiKey = $headers['Key'];
    $request['apiKey'] = $apiKey;
    $request['restaurantID'] = $id;