a!shpInvoke() Function

Invokes the SharePoint 2013 REST endpoint, retrieving the data based on the given path parameter. This function is intended for reads only, and therefore should be used only with an httpMethod value of "GET".


a!shpInvoke( scsExternalSystemKey, usePerUserCredentials, hostname, port, path, httpMethod, timeout, retries, parameters, subsitePath)

Common Parameters:

scsExternalSystemKey: (Text) The key from the Third Party Credentials admin console page that corresponds to the set of credentials that should be used to authenticate.

usePerUserCredentials: (Boolean) If true the credentials set in the Third-Party Credentials settings page by the current user running the expression will be used. If false the site-wide credential values will be used.

hostname: (Text) The scheme and hostname of the SharePoint server. For example, https://sharepoint.example.com.

port: (Number (Integer)) The port on which to connect to the SharePoint server.

path: (Text) The path portion of the REST API URL to invoke. When referring to the SharePoint REST API Reference, this parameter is the part of the URL after the <site url> or <app web url> shown in the examples.

httpMethod: (Text) The HTTP method to invoke: The HTTP method to use when invoking the REST API. Valid values: "GET", "POST", "PUT", "DELETE", "MERGE" - Always use "GET" since a!shpInvoke is intended for read-only calls. timeout: (Number (Integer)) The amount of time, in milliseconds, to wait when attempting to connect to the SharePoint server.

retries: (Number (Integer)) The number of times to retry a connection that fails to connect within the given timeout period.

Specific Parameters:

parameters: (Any Type) The data to use in the body of the request, given as a dictionary. The dictionary is converted to its equivalent JSON form before sending to the endpoint.

subsitePath: (Text) Optional. The path portion of the REST API URL that represents the SharePoint subsite. It must start with a forward slash (/). Leave blank if accessing the base site.


The function returns a dictionary that is equivalent to the JSON object listed in the SharePoint REST API documentation for the endpoint that corresponds to the given path parameter.


List Documents from SharePoint

Copy and paste the expression into the Interface Designer, save it, then call the interface in a Tempo Report to test.

  local!pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: 10,
    sort: a!sortInfo(
      field: "Name",
      ascending: true
    local!sharepointQueryResult: a!shpInvoke(
      scsExternalSystemKey: cons!SHAREPOINT_EXTERNAL_SYSTEM_KEY,
      usePerUserCredentials: true,
      hostname: cons!SHAREPOINT_HOSTNAME,
      port: cons!SHAREPOINT_PORT,
      timeout: cons!SHAREPOINT_TIMEOUT,
      retries: cons!SHAREPOINT_NUM_RETRIES,
      path: "/_api/Web/getfolderbyserverrelativeurl('Shared%20Documents')/Files?$select=Name,ServerRelativeUrl,TimeCreated",
      httpMethod: "GET"
    local!sharepointFilesDataSubset: todatasubset(local!sharepointQueryResult, local!pagingInfo),
      firstColumnContents: {
          label: "Files in Sharepoint",
          totalCount: local!sharepointFilesDataSubset.totalCount,
          columns: {
              label: "Name",
              field: "Name",
              data: local!sharepointFilesDataSubset.data.Name
              label: "Time Created",
              field: "TimeCreated",
              data: local!sharepointFilesDataSubset.data.TimeCreated
          value: local!pagingInfo,
          saveInto: local!pagingInfo

On This Page