Sharepoint | Yext Hitchhikers Platform

Use the Sharepoint Connector to pull in Sharepoint Pages or Sharepoint Items within your Site.

Operations

We have three different Sharepoint operations, each which will return a different set of data from Microsoft Endpoints:

  • Fetch Items (From a Drive)

    • If a top-level drive in your Sharepoint Site contains all your items, use this operation to pull all children items (files, folder data, etc.) from within the specified drive.
  • Fetch Items

    • To fetch all child items of a specific folder, use this operation to specify the parent item from which to pull children.
  • Fetch Pages

    • Use this operation to fetch all the Pages for all Sharepoint Sites
  • Fetch All Pages (From a Site)

    • Use this operation to fetch content and metadata for all pages in one of your Sharepoint Sites.

Fetch Items (from a Drive)

Fetch all the child items (e.g. files, folders) from within the specified Drive in your Sharepoint Site.

Source Inputs

Authentication

Link your Microsoft account which has access to the desired items. See below for more details on linking your account. When choosing a scope, you must include Files.Read.All AND/OR Sites.Read.All

Site ID

Specify the ID of your Sharepoint Site that contains the items you want to fetch. If you are fetching from a Drive that is within your root site, you can optionally just input “root”. See below for instructions on how to find your Site ID.

Drive ID

Specify the ID of the Drive to fetch items from. See below for instructions on how to find your Drive ID.

Data

In order to get all Child items and the associated permissions for each item in your Drive, our system will make the following requests:

https://graph.microsoft.com/v1.0/sites/[siteId]/drives/[driveId]/root/children

  • Fetches all the children in your Drive
  • See the Microsoft Graph Rest API documentation for more details on the data that is returned for a Drive Item.

https://graph.microsoft.com/v1.0/sites/[siteId]/drive/items/[itemId]/permissions

  • Fetches all the permissions associated with each child item
  • See the Microsoft Graph Rest API documentation for more details on the Permissions Endpoint.

Fetch Items

Fetch all the child items (e.g., files) from within the specified parent item (e.g., folder) in your Sharepoint Site.

Source Inputs

Authentication

Link your Microsoft account which has access to the desired items. See below for more details on linking your account. When choosing a scope, you must include Files.Read.All AND/OR Sites.Read.All

Site ID

Specify the ID of your Sharepoint Site that contains the items you want to fetch. If you are fetching items that are within your root site, you can optionally just input “root”. See below for instructions on how to find your Site ID.

Drive ID

Specify the ID of the Drive that contains the parent item. See below for instructions on how to find your Drive ID.

Item ID

Specify the ID of the top level (parent) item from which you want to fetch child items. This will likely be the ID of a folder in your drive. See below for instructions on how to find your Item ID.

Data

In order to get all Child items and the associated permissions for each item, our system will make the following requests:

https://graph.microsoft.com/v1.0/sites/[siteId]/drives/[driveId]/items/[itemId]/children

  • Fetches all the children of your parent item
  • See the Microsoft Graph Rest API documentation for more details on the data that is returned for a Drive Item .

https://graph.microsoft.com/v1.0/sites/[siteId]/drive/items/[itemId]/permissions

  • Fetches all the permissions associated with each child item
  • See the Microsoft Graph Rest API documentation for more details on the Permissions Endpoint .

Fetch Pages

Fetch the Pages for all of your Sharepoint Sites

Source Inputs

Authentication

Link your Microsoft account which has access to the desired items. See below for more details on linking your account. When choosing a scope, you must include Sites.Read.All.

Data

In order to get all Sharepoint Pages, our system will make the following requests:

https://graph.microsoft.com/v1.0/sites?search=*

  • Fetches all Sharepoint Sites in your account

https://graph.microsoft.com/beta/sites/[siteId]/pages

  • Fetches all the Pages for each Sharepoint Site

Fetch All Pages (from a Site)

Fetch content and metadata for all the pages within a specified Sharepoint Site.

Source Inputs

Authentication

Link your Microsoft account which has access to the desired items. See below for more details on linking your account. When choosing a scope, you must include Sites.Read.All

Site ID

Specify the ID of your Sharepoint Site that contains the pages that you want to fetch content from. If you are fetching from your root site, you can optionally just input “root”. See below for instructions on how to find your Site ID.

Data

In order to get all pages (and associated content and metadata) in your Site, our system will make the following requests:

https://graph.microsoft.com/beta/sites/[siteId]/pages

  • Fetches all pages in your Site

https://graph.microsoft.com/beta/sites/[siteId]/pages/[pageId]?select=*&expand=webparts

  • Fetches all the content and metadata for each page

Authentication

Select the Microsoft account to fetch your data from. This account must exist as a Linked Account under the Microsoft Built-in Provider.

You can add a linked account directly from the Connector Settings page (in the dropdown to select a Linked Account), or from Content > Configuration > Linked Accounts > Microsoft.

  • When you click Add Linked Account, you’ll see the following two scopes to add:
    • Files.Read.All
      • Grants Yext permission to read all files on behalf of the authenticated user.
    • Sites.Read.All
      • Grants Yext permission to read documents and list items in all Site Collections on behalf of the authenticated user.

At least one of the two scopes is required for the Fetch Items (From a Root Drive) and Fetch Items operations. Sites.Read.All is required for the Fetch Pages operation.

  • Then click Link and continue through the Microsoft OAuth flow. Once the authentication setup is complete, you’ll need to provide a specific name and ID for your Linked Account. You may want to use the email you linked as the Name, with the email preceded by microsoft. for the Linked Account ID. For example, you might name your Linked Account youremail@gmail.com, with the ID microsoft.youremail@gmail.com.

Pagination

The Connector will paginate through the API response according to Microsoft’s pagination support, as detailed in Microsoft’s pagination documentation . The Connector will return the default page size for the given API.

Retrieve Site IDs, Drive IDs, and Item IDs

these IDs are only accessible via the API. There are a few ways to retrieve the appropriate IDs.

In order to make API requests, you can use the Microsoft developer playground to make sample API calls.

  1. Navigate to https://developer.microsoft.com/en-us/graph/graph-explorer
  2. Add the permission “Sites.Read.All”
  3. Log into your Microsoft Account (in the upper right hand corner)

Site ID

You can use one of the following options to retrieve a Site ID:

If you know the display name of your site, you can use the following API Call:

  • GET https://graph.microsoft.com/v1.0/sites?search={displayName}

To see a list of ALL your Sites, use the following API Call:

  • GET https://graph.microsoft.com/v1.0/sites?search=*

If you know the hostname and relative path (e.g. the Site URL is https://yext.sharepoint.com/sites/mySite ), make the following API Call:

  • GET https://graph.microsoft.com/v1.0/sites/{host-name}:/{server-relative-path} (e.g. GET https://graph.microsoft.com/v1.0/sites/yext.sharepoint.com:/sites/mySite)

The API will response will include a value for “id”. The Site ID to input in the Connector is the ID that is returned WITHOUT the hostname appended (where the hostname might look like yext.sharepoint.com)

Drive ID

You can use one of the following options to retrieve a Drive ID:

To get a list of all Drives in your Site, make the following API Call:

  • GET https://graph.microsoft.com/v1.0/sites/{siteId}/drives

To see a list of all the drive YOU own, use the following API Call:

  • GET https://graph.microsoft.com/v1.0/me/drives

The API will response will include a value for “id”.

Item ID

You can use one of the following options to the ID of a specific Item (e.g Folder):

To get a list of all Items in YOUR Drive, make the following API Call:

  • GET https://graph.microsoft.com/v1.0/me/drive/root/children (ROOT Drive)
  • GET https://graph.microsoft.com/v1.0/me/drive/{drive-id}/children

To search for an Item in a given drive using a keyword, use the following API Call:

  • GET https://graph.microsoft.com/v1.0/drives/{drive-id}/search(q='{keyword}')

To get all the Children of in the Root for any given Drive, use the following API Call:

  • GET https://graph.microsoft.com/v1.0/drives/{drive-id}/root/children

To get all the children of an Item (to get more item IDs for nested Items)

  • GET https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}/children

The API will response will include a value for “id”

Limitations

  • Maximum Pages Listed per Site: 500