0

I'm trying to implement people searching with SharePoint REST API in JS and I've found that it can be done by directly providing SourceId in the request body. So currently my request the next way:

function searchEmployees(value) {
  fetchData(
    `${appWebUrl}/_api/search/postquery`, // App URL
    accessTokens.sharepoint, // Authorization: "Bearer ..."
    'POST', // method
    // Body
    { 
      'request': {
        'Querytext': `${value}`,
        'RowLimit': 30,
        'SourceId': 'b09a7990-05ea-4af9-81ef-edfab16c4e31'
      }
    }
  ).then(renderData);
}

But this SourceId was found in the random internet source, not the official documentation. So basically the questions are next:

  • What is SourceId?
  • What are possible values of SourceId?
  • Is there any good documentation on SourceIds?
  • Is there any good documentation on working with SharePoint for searching people?
  • Is there a better way of searching people? (If there is, why is it better?)
Vladimir Mironov
  • 655
  • 1
  • 7
  • 23

1 Answers1

1

The SourceId is the result sources you defined.

enter image description here

Lee
  • 5,305
  • 1
  • 6
  • 12