return; } //Get a user sent from client and convert it to a json object $jsonMediaOrder = $app->request->getBody(); $objMediaOrder = json_decode($jsonMediaOrder, true); $response = MediaService::updateMediaForEntity($designerId, $experienceId, $entityId, $entityType, $objMediaOrder["mediaOrder"]); Utils::echoResponse($response); }); $app->get('/mediaLibrary/:designerId', function ($designerId) use($app) { //Check authentication $rs = UserService::checkAuthentication($app->request->headers->get('apiKey')); if ($rs["status"] != SUCCESS) { Utils::echoResponse($rs); return; } $response = MediaService::getMediaLibrary($rs['data']->id, $designerId); Utils::echoResponse($response); }); //compress media $app->post('/mediaCompress', function () use($app) { //Check authentication $rs = UserService::checkAuthentication($app->request->headers->get('apiKey')); if ($rs["status"] != SUCCESS) { Utils::echoResponse($rs); return; } //Get a user sent from client and convert it to a json object $jsonMedia = $app->request->getBody(); $objMedia = json_decode($jsonMedia, true); $objMedia['fileName'] = $rs['data']->id; //So even with a valid apiKey, the designer can access her own resources only