Hi Miguel,
If you pay attention to what you will see in REST API design guidelines, such case is NOT covered indeed.
Reason for that is Tasks are meant to be some 'last resort' option in case the regular CRUD design would not fly to cover specific use-cases, but still the design of a Task, like any regular CRUD operation, is resource type centric, i.e. is supposed to apply to single resource type.
One relevant example of defining a Task is actual bulk operations, but those would apply on ONE resource type. as can be seen from the URI itself:
https://mydomain/myresourcetype/bulkupdate, for example (you can see it sits in the scope of 'myresourcetype', by nature).
Then if you need to expose single API that would operate - eventually in transactional manner - on multiple types of resources, then this is not part of the regular REST approach, BUT there is room for aggregation or composition on top of regular REST APIs at upper level (enablers levering of regular REST APIs at API Gateway / Managenement level or other frameworks).
------------------------------
Christophe MICHEL
Amdocs Management Limited
------------------------------
Original Message:
Sent: Sep 17, 2021 13:14
From: Miguel Leal
Subject: TASK Resource to create 2 different identities in same request
Hello,
I've read the TMF630 REST API Design part 1 regarding the Task Resource guidelines, however - probably because I'm new on this - I was not able to find a clear response to my questions.
In my use case, due to several reasons, we have the need to create with same API request, 2 different instances. For example. imagine we need to create 1 service entity (according TMF638) and 1 billingAccount (according TMF666) - in the same request.
For that purpose we would create a Task resource under service inventory named for instance "ServiceFull", which will receive all the information from Service entity and also the billingAccount entity.
I was trying to find a JSON example, showing a similar type of TASK resource - i.e. showing the creation of 2 different resource types, which are usually created with different APIs, but without success. Does anyone has an example/sample of such type of TASK request?
Many thanks,
Miguel Leal
------------------------------
Miguel Leal
Nokia
------------------------------