- User Manuals /
- Virtual DataPort Administration Guide /
- Creating Data Sources and Base Views /
- Software as a Service Wizards /
- SharePoint REST API
SharePoint REST API¶
SharePoint includes a REST service that is comparable to the existing SharePoint client object models. Now, it is possible to interact directly with SharePoint objects by using any technology that supports standard REST capabilities.
Importing Artifacts¶
After creating the OAuth tokens, you have all the data needed to use the SharePoint wizard. Click the menu File > New > Data source and select Microsoft SharePoint REST API.
Microsoft SharePoint REST API wizard¶
Enter the following parameters:
Database. Name of the database in which the SharePoint data sources and views will be created.
View name prefix. The name prefix of every view created in order to be able to relate VDP views to SharePoint Online sites. The max length of this parameter is 10 characters.
SharePoint Online service name . Your SharePoint Online service name (tenant name).
Realm. The directory tenant id.
Client ID. The client id generated when registering the Azure app.
Client Secret. The client secret generated when registering the Azure app.
Redirect URI. The redirect URI registered when creating the Azure app.
Access token . The access token generated in the previous step.
Refresh token . The refresh token generated in the previous step.
Site name. The site name of the specific SharePoint Online site you want to retrieve list and folders content.
Now, click Execute import to create the data sources and the views to query SharePoint.
Note
The views created are read-only.
Note
We have used site2 as the value of the View name prefix configuration parameter in the examples shown below.
SharePoint data source and views created¶
${view.prefix}_all_lists. Retrieving all the lists of the SharePoint site specified in the Site name property.
${view.prefix}_file. Retrieving a file.
Required parameters:
file_path: The path to the file.
${view.prefix}_file_list_item_all_fields. Retrieving the value of the
ListItemAllFieldsproperty of the file.Required parameters:
file_path: path to the file.
${view.prefix}_file_modified_by. Retrieving the value of the ModifiedBy property of the file.
Required parameters:
file_path: path to the file.
bv_${view.prefix}_file_version_events. Retrieving the value of the VersionEvents property of the file.
Required parameters:
file_path: path to the file.
bv_${view.prefix}_file_versions. Retrieving the value of the Version property of the file.
Required parameters:
file_path: path to the file.
bv_${view.prefix}_files_attached_to_list. Retrieving all the files that are attached to a list item.
Required parameters:
list_name: the name of the list.item_id: the id of the item.
${view.prefix}_files_in_folder. Retrieving the files in a folder.
Required parameters:
folder_path: the path of the folder.
${view.prefix}_folder. Retrieving info about the folder.
Required parameters:
folder_path: the path to the folder.
${view.prefix}_folder_parent. Retrieving the value of the ParentFolder property of the folder.
Required parameters:
folder_path: the path to the folder.property_name: the name of the property.
bv_${view.prefix}_items_by_list_name. Retrieving all items in a list.
Required parameters:
list_name: the name of the list.
bv_${view.prefix}_list_as_stream. Retrieving items as a stream.
Required parameters:
list_name: the name of the list
${view.prefix}_list_by_guid. Retrieving the details of a list by GUID.
Required parameters:
guid: The list guid.
${view.prefix}_list_by_name: Retrieve a list by name.
Required parameters:
list_name: the name of the list
${view.prefix}_subfolders_in_folder. Retrieving the folders in a folder.
Required parameters:
folder_path: the path to the folder.
${view.prefix}_web. Retrieving the details of the site specified in the Site name property.
bv_${view.prefix}_web_title. Retrieving the title of the site specified in the Site name property.
bv_${view.prefix}_excel_file. Retrieving a Microsoft Excel file. The number of columns in this view is only three as a sample, because the number of columns in an Excel file cannot be known a priori.
Required parameters:
file_path: the path of the file to retrieve.
${view.prefix}_folder_full_content. Retrieving both the files and the folders of the folder.
Required parameters:
folder_path: the path of the folder.
Note
All paths are relative to /sites/${sharepoint.site.name}/.
Query Example¶
Now, you can execute queries on the SharePoint Online views that have been created:
Query 1. Retrieving all the content of the folder
MyLibrary.
Querying site2_folder_full_content view¶
site2_folder_full_content query result¶
Query 2. Retrieving the files attached to the item 2 attached to
MyListlist.
Querying bv_site2_files_attached_to_list view¶
bv_site2_files_attached_to_list query result¶
Query 3. Retrieving an Excel file.
Querying bv_site2_excel_file view¶
bv_site2_excel_file query result¶
