Hi community,
in order to follow best practises for RESTful API I would like to use Singletons
like /customers/{customerId} and potentially some subcollections / multiple level Sigletons like /customers/{customerId}/accounts/{accountId}
Is there any way to configure the User Defined API Routes to work like this?
Create an dataminer api endpoint on /customers/
and use that script to determinate the path:
https://docs.dataminer.services/dataminer/Functions/User-Defined_APIs/Defining_an_API/UD_APIs_Examples.html#using-the-requestmethod-and-route
<code class="lang-csharp hljs language-csharp" data-highlighted="yes"><span class="hljs-function"><span class="hljs-keyword">public</span> ApiTriggerOutput <span class="hljs-title">OnApiTrigger</span>(<span class="hljs-params">IEngine engine, ApiTriggerInput requestData</span>)</span> { <span class="hljs-keyword">switch</span> (requestData.Route) { <span class="hljs-keyword">case</span> <span class="hljs-string">"chains/change-status"</span>: <span class="hljs-keyword">return</span> HandleStateChangeRequest(requestData); <span class="hljs-keyword">case</span> <span class="hljs-string">"chains/status"</span>: <span class="hljs-keyword">return</span> HandleStateRetrievalRequests(requestData); }</code>