Interacting with file entities
Make use of the file entity data pages to interact with your SharePoint files
directly from your Pega application. In addition to
retrieving information about specific files, you can use these data pages to create and
delete files. Moreover, you can check files in or out, as well as update their
content. When referenced, the D_SPOnlineAddTemplateFile data page posts
information to add a hosted file to an existing SharePoint list or document
library. For example,
For example,
When referenced, the D_SPOnlineCreateFile data page posts
information to create a file and add it to an existing folder. For example,
When referenced, the D_SPOnlineDeleteFile data page posts
information to delete an existing file. With
the Recycle parameter set to
true: For example,
When referenced, the D_SPOnlineFileCheckIn data page attempts to
check in a checked-out file. The data page uses
CheckinComments/CheckinType to version the
file. For example,
When referenced, the D_SPOnlineFileCheckout data page posts
information to check out a single file. For example,
When referenced, the D_SPOnlineGetFileContent data page returns
the content of a single file. For example,
For example, 2.15. When referenced, the D_SPOnlineGetFileContent data page returns
a list of files from a single folder. For example,
For example, in an ID eq 2
expression, ID is the field name,
eq is the equality operator, and
2 is the matching value. For
more information about the supported operators and query
options, refer to the SharePoint documentation. For
example, you can display the results sorted by title in a
descending order, by specifying Title
Desc for this parameter. For example, if you sort by
title in a descending order and configure the data page to skip
titles until K, the call retrieves all
titles that start with the letters from the
K to
A range. When referenced, the D_SPOnlineGetFileVersions data page returns
information about the version and history of a single file. For example,
When referenced, the D_SPOnlineGetFileCurrentVersion data page
returns metadata and the current version of a single file. For example,
When referenced, the D_SPOnlineUpdateFileContent data page posts
information to update the content of an existing file. For example,
When referenced, the D_SPOnlineGetFileMetadata data page returns
metadata for a single file. For example,
When referenced, the D_SPOnlineUpdateFileTitle data page posts
information to update the title of an existing file. For example,
Adding a hosted file to a list or library
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineAddTemplateFile Int-SPO-File https://<site_url>/_api/web/GetFolderByServerRelativeUrl('<FolderPath'>)/files/addTemplateFile(urloffile='TemplateFilePath',templatefiletype=TemplateFileType) POST Data page parameters
Name Description Required FolderPath Specifies the folder path. Documents/Test
.✅ TemplateFileName Specifies the name of the template file
along with the corresponding file extension. contacts.txt
.✅ TemplateFileType Specifies the file template
type. ✅ SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ Creating a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineCreateFile Pega-API-Storage-File https://<site_url>/_api/web/GetFolderByServerRelativeUrl('FolderPath')/Files/add(url='FileName',overwrite=true) POST Data page parameters
Name Description Required FolderPath Specifies the folder path. Documents/Test
.✅ FileName Specifies the file name for which you want
to perform this operation. ✅ FileContent Specifies the content of the file in
the Base64 encoded format. ✅ SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ Deleting a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineDeleteFile Pega-API-Storage-File https://<site_url>/_api/web/GetFileByServerRelativeUrl('FilePath') POST Data page parameters
Name Description Required FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ Recycle Specifies whether to move the file to the
recycle bin. ❌ SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ IfMatchHeader Specifies a valid ETag value to use during
the operation. The default value is
*. ✅ Checking in a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineFileCheckIn Int-SPO-FileCheckin https://{site url}/_api/web/GetFileByServerRelativeUrl
(‘<file path>’)/checkin PUT Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ CheckinComments Specifies the file check-in
comments. ❌ CheckInType Specifies one of the following check-in
types: MinorCheckIn = 0;
MajorCheckIn = 1;
OverwriteCheckIn = 2. ✅ Checking out a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineFileCheckout Int-SPO-FileCheckout https://{site url}/_api/web/GetFileByServerRelativeUrl
(‘<file path>’)/checkout POST Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ Retrieving file content
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineGetFileContent Pega-API-Storage-File https://{site url}/_api/web/ GetFileByServerRelativeUrl
(‘<file path>’)/ $value GET Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ Version Specifies the version of the file in the
MajorVersion.MinorVersion
format. ❌ Retrieving a list of files
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineGetFiles Int-SPO-ListFiles https://{site url}/_api/web/
GetFolderByServerRelativeUrl (‘<folder
path>’)/files GET Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ SelectFields Specifies the fields to retrieve. ❌ SelectItems Specifies the items to retrieve. You can use
this filter to return results that match a simple logical
expression. ❌ OrderBy Specifies the sorting (by field) and order
(ascending or descending) in which the results are displayed. ❌ TopNItems Retrieves the top n
(integer value) results. ❌ SkipUntil Skips over items until the specified item is
reached, and then returns the rest. ❌ Retrieving the versioning history of a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineGetFileVersions Int-SPO-FileVersions https://{site url}/_api/web/ GetFileByServerRelativeUrl
(‘<file path>’)/ versions POST Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ Retrieving the current version and metadata of a file
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineGetFileCurrentVersion Int-SPO-CurrentFileVersion https://{site url}/_api/web/ getfilebyserverrelativeurl
(‘<file path>’)/
?$select=FileLeafRef,UiVersionLabel GET Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ Updating file content
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineUpdateFileContent Int-SPO-UpdateFileContent https://{site url}/_api/web/ GetFileByServerRelativeUrl
(‘<file path>’)/ $value POST Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FilePath Specifies the file path. Documents/Test/contacts.txt
.✅ FileContent Specifies the content of the file in
the Base64 encoded format. ✅ Retrieving file metadata
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineGetFileMetadata Int-SPO-FileMetadata https://{site
url}/_api/Web/getFileByServerRelativeUrl('<file
path>')/listItemAllFields GET Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FolderPath Specifies the folder path. Documents/Test
.✅ FileName Specifies the file name for which you want
to perform this operation. ✅ Updating file title
Data page details
Data page Data type SharePoint API HTTP method D_SPOnlineUpdateFileTitle Int-SPO-UpdateFileTitle https://{site url}/_api/Web/Lists(guid'Folder Id as
List')/Items(<File ID as List Item>) POST Data page parameters
Name Description Required SiteName Overrides the default site in
SPOnlineSetings. ❌ AuthProfile Overrides the default authentication profile
in the SPOnlineSetings data transform. ❌ FolderPath Specifies the folder path. Documents/Test
.✅ FileName Specifies the file name for which you want
to perform this operation. ✅ FileTitle Specifies the new title for the file that you
want to update. ✅
Previous topic Interacting with folder entities Next topic Managing integrations