Hi
Probably a newbie question (sorry for that) but if I want to generate an API entry like below. Can I use the Business Logic module or I need to create a script in the Files Manager?
I am a bit unclear yet.
Endpoint: POST ratings
Description: assign a rating to a user and quote, in the ‘ratings’ table
Parameters:
userId [mandatory]:id of the current user
quoteId [mandatory]:id of the quote to be rated
rating [mandatory]:int from 1 to 5
Processing:
Rating is inserted into ‘ratings’ table and timestamped
Expected Output:
To the following request: /api/v1/ratings/?u=123&q=8945&r=3
[{“status”:“200”}]
Where
Yes, you should use hosted services.
Here are some helpful links for you to start:
documentation on api services: https://backendless.com/documentation/business-logic/js/apieng_overview.htm
Sample of "Shopping Cart" written on NodeJS: https://github.com/Backendless/JS-Code-Runner/blob/master/examples/services/shopping-cart.js
Are the models/ files created by Backendless? I surmised they are directly related to the data declared in Backendless and would, therefore, be easily generated but maybe I am wrong?
No, the models are the classes you create which are used in your service signatures or within the implementation of your service. What’s generated is the actual REST API once you deploy the service.