Scenario

Fetching Specific List Information

Objective

You want to retrieve the ID and Title of a specific SharePoint list whose title matches a given name.

Steps:

  • Identify the List Title: You have a SharePoint site with multiple lists, and you need to fetch the ID and Title of a list named “Project Documents”.
  • Construct the HTTP Request: Use the SharePoint REST API to filter the lists by title and select only the ID and Title fields.
  • Execute the HTTP Request: Make an HTTP GET request to the SharePoint REST API endpoint with the appropriate query parameters.
Method: GET

Uri: _api/web/lists?$filter=Title eq 'name'&$select=Id,Title

Headers:
  Accept: application/json;odata=verbose