I am actually following the tutorial for REST API in Codeigniter http://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814
It works fine for simple use cases.
But I would to set custom routes url to have the use of my api more user friendly, I explain...
For example : I want to get the list of students of a dedicated classroom I would like the user to set http:myurl/api/classroom/1/students/
In route config files I set : $route['api/classroom/(:num)/students/'] = 'api/classroom/students/$1';
It does not work because the REST API interprete the (:num) as a method/function. Is there a way to manage this case ?
In another case, it should be nice to have the following use case : for classroom id 1, get data for student with id 2 => http:myurl/api/classroom/1/students/2
Thanks for your help :)
classroom.php:function students($id_classroom = null, $id_student = null){? Maybe you should delete theapi/from your route assignation part. - JP. Aulet