In my opinion, REST is about resources. In this case, the resources are the bananas and the oranges. If you suppose for example that you could retrieve a banana or an orange by id, then your endpoints would be:
/oranges/{id}
/bananas/{id}
So i would not make a /conversions
endpoint, but I would use something like this:
/oranges/frombanana
or /oranges/from_banana
/bananas/fromorange
or /bananas/from_orange
Anyway I don't really think there is a very well established naming convention, so I would not find weird any of the endpoints proposed above. Anyway, I don't find very self-explanatory the first two ones; what does /conversions/orange/banana
do? Does it convert orange to banana or does it convert orange from banana? Maybe something like /conversions/banana/to/orange
would be more self-explanatory.
Just for reference, here they are some APIs for cloud storage services:
- Dropbox APIs: https://www.dropbox.com/developers/documentation/http/documentation
- Box APIs: https://developer.box.com/reference
or also PayPal: https://developer.paypal.com/docs/api/balance-accounts/