Is the API designed as one or split into multiple?

I now provide interfaces to the front end. When designing an API, should I try to complete an operation in one API or split it into multiple API?

for example, do a function to upload a picture, upload the picture to the file and return it to url, and save it to the database.
can be designed as two API, or it can be done within one API.

for example, when you delete a group, the users in the group are also deleted. It can also be designed as one or two API.

how exactly is it designed? What is suitable for each scene? Pros and cons?


I am the front end. From the front end point of view, of course it is an api interface.

for example, do a function to upload an image, upload the image to the file and return it to url, and save it to the database.

just return url to the picture. As for saving it to the database, does it need to be given to the front-end interface?


my experience is that the front-end processing of obtaining api data is simple, and the front-end data submitted to api data back-end processing is simple.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e41906-44943.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e41906-44943.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?