Transformations can be mapped to sub-resources (children) of objects, but it is important to know that transformed sub-resources are not added to the API Docs. To accomplish this task, you have to create a common resources and transformation to the sub-object within the root object. For example, in Connectwise CRM there is a sub-resource time-entries
within incidents
(e.g., /incidents/{id}/time-entries
). Create a common resource that includes the fields you require, and then map a Connectwise Transformation to this resource for the incidentsTimeEntries
object.
Since this transformed sub-resource is not added to Swagger you will need to make API calls through GET /{objectName}/{id}/{childObjectName}
where the objectName
is the original resource and the childObjectName
is the transformed sub-resource. Here is a Connectwise CRM example that shows mapping of the sub/child resource incidentsTimeEntries
to a common resource called "myIncidentTime".
With this transformation in mind and knowing that you are trying to reach the sub-resource/child object (in this example incidentsTimeEntries
), here is an example of how you must make the API call to:
/{objectName}/{id}/{childObjectName}
/incidents/{id}/myIncidentTime