I have two API endpoints, Person
and Domain
. Each of them has an own controller, used to handle GET/POST/PUT/DELETE
requests.
Now, a domain
has to be assigned to a person
, so what I thought was the following. When adding a Person
the user can send JSON to the REST API containing an URL
which will be saved as a new Domain
.
This is just a simple example. In the real life example, I have many other endpoints like FacebookAccount
, LinkedInAccount
, GooglePlusAccount
etc.
My main question is: Is it a good practice, to allow the API user to add data to multiple Endpoints/Ressources
in one request? Because, what I see as a problem is the following:
I don't want the user to do 10 requests to add a person with all his data like his domains, Facebook accounts etc. if he has multiple.