what approach will be the best practice for getting the multiple child records using Sharepoint v1 REST APIs?

Jitterbit SE 1 Reputation point
2022-12-22T06:59:46.64+00:00

I am using SharePoint v1 REST APIs. I need to query the child records of the models. Currently, as per the Microsoft documentation, there is an API
GET /_api/machinelearning/models/getbytitle('{modelFileName}') HTTP/1.1
reference link : https://learn.microsoft.com/en-us/sharepoint/dev/apis/syntex/rest-getbytitle-method?source=recommendations .

This API has a limitation that it can perform query for a single child record. So, Do SharePoint has a different API that can fetch multiple child records in a single hit? what approach will be the best practice for getting the multiple child records?

Current API used for fetching child records :

273212-ed86ab35-5465-4998-b236-64bc58ba2c6d.png

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,486 Reputation points Microsoft External Staff
    2022-12-22T08:54:47.463+00:00

    Hi @Jitterbit SE
    You can refer to following api to get multiple child records

    https://xxx.sharepoint.com/sites/123/_api/Web/lists/getbytitle('TestList001')/items?$select=Title,ID,Name,age  
    

    And you will get response like following pic
    273196-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Jitterbit SE 1 Reputation point
    2022-12-22T12:44:57.437+00:00

    Thanks for your response!

    https://xxx.sharepoint.com/sites/123/_api/Web/lists/getbytitle('TestList001')/items?$select=Title,ID,Name,age  
    

    In the above scenario , I can only perform query for a single module 'TestList001' and single child object 'items'.

    But actually, I need to perform query for fetching multiple child records related to distinct modules in a single go .
    For e.g : I have 4 modules and every module contains different childs objects such as (items, Author etc).
    So, Is there any API through which I can get the child records for different modules and child objects?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.