I'm currently designing a REST API interface and am trying to decide on the best way to structure the calls.
I am providing the ability to create a record in the system. However, the record could be created using two different sets of data, depending on which system calls the data.
I was thinking of providing a url in the format
/api/create/auto
/api/create/manual
and using the same function (the auto/manual would be a route parameter) to process, with the body containing the appropriate data. However I was wondering if providing url in the format
/api/createauto
/api/createmanual
and use two separate functions to process is a better format to use. The processing involved is fairly simple, I'm just going to take the incoming data and pass it to one of two stored procedures in the database to do the work. If I do it the first way I have to add validation to ensure only the correct values are passed.