M
M
Messi2020-09-11 13:34:13
RESTful API
Messi, 2020-09-11 13:34:13

What endpoints will be correct?

Hello, there is an API. There is a table in the car_shops database:
car_id (foreign key for the car ( id) table) unique for this table
shop_id (foreign key for the shop ( id) table) unique for this table
link (string)

Need CRUD (api endpoints), done:
GET api/car-shops - get all entries from this table.
I don’t know how to delete and receive correctly, I did it this way, if this is not correct, please tell me how to do it right:

GET api/car-shops/byCar/{id} - get all records from this table by car id
GET api/car- shops/byShop/{id} - get all records from this table by shop id

POST api/car-shops/delete/byCar/{id} - delete record from this table by Car id
POST api/car-shops/delete/byShop/{id} - delete an entry from this table by Shop id

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex4answ, 2020-09-11
@alex4answ

1. Why prefix car ?
Make endpoint: /api/shops and filter with type=car (for example)
2. What is byCar,byShop ?
3. what are POST requests for delete ?
You should use HTTP
methods

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question