Show: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CollabMSGraphClient
Signature
global with sharing class CollabMSGraphClient
Enums
CollabMSGraphClient Methods
arrayOfChats(parser)
Signature
global static List<Chat> arrayOfChats(JSONParser parser)
createChatMessage(userId, channelName, htmlMessage)
Signature
global static CreateChatMessageResponse createChatMessage(String userId,String channelName,String htmlMessage)
Parameters
userId
Type:
String
UserId or empty for "current user"
channelName
Channel name
htmlMessage
Message in HTML
Returns
Completion status
Example
createChatMessageWithQueue(userId, channelName, htmlMessage, queueable)
Signature
global static CreateChatMessageResponse createChatMessageWithQueue(String userId,String channelName,String htmlMessage,List<Queueable> queueable)
createFolder(userId, driveId, parentId, name)
Signature
global static SaveFileResponse createFolder(String userId, String driveId, String parentId, String name)
See
createSharingLink(userId, driveId, itemId)
creates a shareable link.
Signature
global static CreateLinkResponse createSharingLink(String userId, String driveId, String itemId)
Parameters
userId
Type:
String
user ID
driveId
Type:
String
drive ID
itemId
Type:
String
item Id
expirationDate
expiration date
userEmails
user emails registerd as user in SharePoint
Returns
create a shareable link, the <var>link.webUrl</var> field contains the shareable link
Example
ensurePath(userId, driveId, path)
Signature
global static Boolean ensurePath(String userId, String driveId, String path)
See
getDrive(userId, siteUrl)
Get drive from URL. You probably do not want to use this. #getSiteDrive()
Signature
global static GetDriveResponse getDrive(String userId, String siteUrl)
Parameters
userId
Type:
String
user Id
siteUrl
Type:
String
site URL
Returns
corresponding drive
See
CollabMSGraphClient.getSiteDrive()
getDriveItemByPath(userId, driveId, path)
Signature
global static GetDriveResponse getDriveItemByPath(String userId, String driveId, String path)
See
getDriveItemsById(userId, driveId, childId)
Retrieve drive items(children) in drive "driveId" identified by <var>childId<var>
Signature
global static GetDriveContentResponse getDriveItemsById(String userId, String driveId, String childId)
Parameters
userId
Type:
String
User Id
driveId
Type:
String
drive ID
childId
Type:
String
child id
Returns
drive item with id <var>childId</var>. See: GetDriveContentResponse
See
CollabMSGraphClient.getDriveItemByPath to get the children
Example
getDriveItemsByPath(userId, driveId, path)
Retrieve drive items (children) in drive "driveId" at path <var>path</var>
Signature
global static GetDriveContentResponse getDriveItemsByPath(String userId, String driveId, String path)
Parameters
userId
Type:
String
User Id
driveId
Type:
String
drive ID
path
Type:
String
path
Returns
drive items (children) at path <var>path</var>. See: GetDriveContentResponse
See
CollabMSGraphClient.getDriveItemByPath to get the item itself
Example
getFile(userId, url, isLibrary, path)
Gets a SharePoint file
Signature
global static GetFileResponse getFile(String userId, String url, Boolean isLibrary, String path)
Parameters
userId
Type:
String
the user of which the SharePoint credentials should be used. Current user: UserInfo.getUserId()
url
Type:
String
Site Library Url
isLibrary
Type:
Boolean
unless you are using an old version, use "true"
path
Type:
String
sharepoint library folder patch
Returns
GetFileResponse object
Example
getFileAsPDF(userId, url, isLibrary, path)
Converts a SharePoint file into PDF - Remote Site Setting: https://westeurope1-mediap.svc.ms
Signature
global static GetFileResponse getFileAsPDF(String userId, String url, Boolean isLibrary, String path)
Parameters
userId
Type:
String
the user of which the SharePoint credentials should be used. Current user: UserInfo.getUserId()
url
Type:
String
Site Library Url
isLibrary
Type:
Boolean
unless you are using an old version, use "true"
path
Type:
String
sharepoint library folder patch
Returns
GetFileResponse object
Example
getRefreshedToken(userId)
Get a refreshed OAuth token. This method will save this token to the user, so afterwards, it will not be possible to callout to SharePoint in the same request
Signature
global static String getRefreshedToken(String userId)
Parameters
userId
Type:
String
the user id
Returns
refreshed token
getSiteDrive(userId, libraryUrl)
Signature
global static GetDriveResponse getSiteDrive(String userId, String libraryUrl)
See
isSubsite(domain, siteName, possibleSubSiteName, token)
Signature
global static Boolean isSubsite(String domain,String siteName,String possibleSubSiteName,String token)
Parameters
domain
Type:
String
Sharepoint domain
siteName
Sharepoint site
possibleSubSiteName
Sharepoint subsite
token
Sharepoint auth token
Returns
Whether <var>possibleSubSiteName</var> is a sub site of <var>siteName</var> for domain <var>domain</var>
See
CollabOAuthController.getSavedToken
isTokenValid(userId)
Check Sharepoint <var>access_token</var> token validity.
Signature
global static Boolean isTokenValid(String userId)
Parameters
userId
Type:
String
User Id with the <var>access_token</var> to check
Returns
validity of the access_token.
parse(json)
Signature
global static CreateLinkResponseData parse(String json)
refreshToken(userId)
Get a refreshed OAuth token. This method will save this token to the user, so afterwards, it will not be possible to callout to SharePoint in the same request
Signature
global static String refreshToken(String userId)
Parameters
userId
Type:
String
the user id
Returns
refreshed token
refreshTokenWithQueue(userId, queueables)
Signature
global static String refreshTokenWithQueue(String userId,List<Queueable> queueables)
renameFolder(userId, url, isLibrary, basePath, sourceName, targetName)
Signature
global static SaveFileResponse renameFolder(String userId,String url, Boolean isLibrary, String basePath, String sourceName,String targetName)
See
sanitizeFileName(dirtyFilename)
Signature
global static String sanitizeFileName(String dirtyFilename)
See
sanitizeFolderName(dirtyFolderName)
Signature
global static String sanitizeFolderName(String dirtyFolderName)
See
sanitizeFolderOrFileName(dirtyFolderOrFilename)
Only use if required. This attempt to detect if it's a file or folder by looking up for a dot (".") and apply the "appropriate" sanitization.
Signature
global static String sanitizeFolderOrFileName(String dirtyFolderOrFilename)
Parameters
dirtyFolderOrFilename
Type:
String
file or folder name
Returns
sanitized folder or file name
sanitizeFolderPath(dirtyFolderPath)
Signature
global static String sanitizeFolderPath(String dirtyFolderPath)
See
saveFile(userId, url, isLibrary, path, fileContent)
Saves a file to the specified path in a drive or document library.
Signature
global static SaveFileResponse saveFile(String userId, String url, Boolean isLibrary, String path, Blob fileContent)
Parameters
userId
Type:
String
The user ID for which the file should be saved.
url
Type:
String
The URL of the SharePoint site or document library where the file should be saved.
isLibrary
Type:
Boolean
A boolean indicating whether the destination is a document library (true) or a SharePoint site (false).
path
Type:
String
The path to save the file, including the file name and extension.
fileContent
Type:
Blob
The content of the file as a Blob.
Returns
A SaveFileResponse object containing either the saved file's metadata or an error object.
Example
saveFile(userId, driveUrl, path, fileContent)
Save file in a site drive
Signature
global static SaveFileResponse saveFile(String userId, String driveUrl, String path, Blob fileContent)
Parameters
userId
Type:
String
user ID
driveUrl
Type:
String
drive URL
path
Type:
String
target path
fileContent
Type:
Blob
file content
Returns
saved file
saveFileById(userId, driveId, parentId, fileName, fileContent)
Signature
global static SaveFileResponse saveFileById(String userId, String driveId, String parentId, String fileName, Blob fileContent)
See
updateColumns(userId, driveId, itemId, fields)
Update columns values (fields) for file in a site drive using IDs. Warning: the files has to be part of a LIST.
Signature
global static SaveFileResponse updateColumns(String userId,String driveId, String itemId,Map<String,String> fields)
Deprecated
use CollabMSGraphClient.updateMetadataColumns instead.
Parameters
userId
Type:
String
user ID
driveId
drive ID
itemId
Type:
String
parent ID
fields
custom columns values (fields) for file
Returns
saved file, the id field contains the list item id
See
CollabMSGraphClient.getDriveItemByPath - to retrieve itemId from drive and path, CollabMSGraphClient.getDrive - to retrieve driveId for sites, CollabMSGraphClient.getSiteDrive - to retrieve driveId for lists
Example
updateContentType(userId, driveId, itemId, contentTypeId)
Update ContentType for file in a site drive using IDs. Warning: the files has to be part of a LIST.
Signature
global static SaveFileResponse updateContentType(String userId,String driveId, String itemId,String contentTypeId)
Parameters
userId
Type:
String
user ID
driveId
drive ID
itemId
Type:
String
parent ID
contentTypeId
custom ContentType for file
Returns
saved file, the id field contains the list item id
updateMetadataColumns(userId, driveId, itemId, fields)
Update columns values (fields) for file in a site drive using IDs. Warning: the files has to be part of a LIST.
Signature
global static SaveFileResponse updateMetadataColumns(String userId,String driveId, String itemId,Map<String,Object> fields)
Parameters
userId
Type:
String
user ID
driveId
drive ID
itemId
Type:
String
parent ID
fields
custom columns values (fields) for file
Returns
saved file, the id field contains the list item id
See
CollabMSGraphClient.getDriveItemByPath - to retrieve itemId from drive and path, CollabMSGraphClient.getDrive - to retrieve driveId for sites, CollabMSGraphClient.getSiteDrive - to retrieve driveId for lists
Example
urlEncodeDirPath(url)
Convenience method for encoding url's pointing to a DIRECTORY.
Signature
global static String urlEncodeDirPath(String url)
Parameters
url
Type:
global static String
Url to encode
Returns
url-encoded URL
urlEncodeFilePath(url)
Convenience method for encoding url's pointing to a FILE.
Signature
global static String urlEncodeFilePath(String url)
Parameters
url
Type:
global static String
Url to encode
Returns
url-encoded URL
CollabMSGraphClient.Application
Signature
global class Application
CollabMSGraphClient.Application Properties
CollabMSGraphClient.Application ConstructorsApplication(parser)
Signature
global Application(JSONParser parser)
CollabMSGraphClient.Chat
Represent a chat
Signature
global class Chat
CollabMSGraphClient.Chat Properties
CollabMSGraphClient.Chat ConstructorsChat(parser)
Signature
global Chat(JSONParser parser)
CollabMSGraphClient.CreateChatMessageResponse
Signature
global class CreateChatMessageResponse
CollabMSGraphClient.CreateChatMessageResponse Properties
CollabMSGraphClient.CreateChatMessageResponse Methods
isError()
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.CreateDraftEmailResponse
Signature
global class CreateDraftEmailResponse
CollabMSGraphClient.CreateDraftEmailResponse Properties
CollabMSGraphClient.CreateDraftEmailResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.CreateDraftEmailResponseData
Signature
global class CreateDraftEmailResponseData
CollabMSGraphClient.CreateDraftEmailResponseData Properties
CollabMSGraphClient.CreateDraftEmailResponseData ConstructorsCreateDraftEmailResponseData(parser)
Signature
global CreateDraftEmailResponseData(JSONParser parser)
CreateDraftEmailResponseData(id)
Signature
global CreateDraftEmailResponseData(String id)
CollabMSGraphClient.CreateLinkResponse
Signature
global class CreateLinkResponse
CollabMSGraphClient.CreateLinkResponse Properties
CollabMSGraphClient.CreateLinkResponse Methods
isError()
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.CreateLinkResponseData
Represent data on link creation
Signature
global class CreateLinkResponseData
CollabMSGraphClient.CreateLinkResponseData Properties
CollabMSGraphClient.CreateLinkResponseData ConstructorsCreateLinkResponseData(parser)
Signature
global CreateLinkResponseData(JSONParser parser)
CollabMSGraphClient.DriveItemResponse
Class to wrap an item, eg File, in a folder
Signature
global class DriveItemResponse
CollabMSGraphClient.DriveItemResponse Properties
CollabMSGraphClient.DriveItemResponse ConstructorsDriveItemResponse(parser)
Signature
global DriveItemResponse(JSONParser parser)
DriveItemResponse(id, name, longSize, webUrl)
Signature
global DriveItemResponse(String id,String name,Long longSize,String webUrl)
CollabMSGraphClient.GetChatsResponse
Signature
global class GetChatsResponse
CollabMSGraphClient.GetChatsResponse Properties
CollabMSGraphClient.GetChatsResponse Methods
isError()
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
Returns
whether there is a specific error designed by errorCode
CollabMSGraphClient.GetChatsResponseData
Represent chat response
Signature
global class GetChatsResponseData
CollabMSGraphClient.GetChatsResponseData ConstructorsGetChatsResponseData(parser)
Signature
global GetChatsResponseData(JSONParser parser)
CollabMSGraphClient.GetDriveContentResponse
Class to wrap the Drive content returned from SharePoint
Signature
global class GetDriveContentResponse
CollabMSGraphClient.GetDriveContentResponse Properties
CollabMSGraphClient.GetDriveContentResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.GetDriveResponse
Class to wrap the Drive information returned from SharePoint
Signature
global class GetDriveResponse
CollabMSGraphClient.GetDriveResponse Properties
CollabMSGraphClient.GetDriveResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.GetDriveResponseData
Class to wrap the Drive response from SharePoint
Signature
global class GetDriveResponseData
CollabMSGraphClient.GetDriveResponseData Properties
CollabMSGraphClient.GetDriveResponseData ConstructorsGetDriveResponseData(parser)
Signature
global GetDriveResponseData(JSONParser parser)
GetDriveResponseData(id)
Signature
global GetDriveResponseData(String id)
CollabMSGraphClient.GetFileResponse
Class to wrap the File returned from SharePoint
Signature
global class GetFileResponse
CollabMSGraphClient.GetFileResponse Properties
CollabMSGraphClient.GetFileResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
CollabMSGraphClient.GrantSharingLinkResponse
Signature
global class GrantSharingLinkResponse
CollabMSGraphClient.GrantSharingLinkResponse Properties
CollabMSGraphClient.GrantSharingLinkResponse Methods
isError()
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
Returns
whether there is a specific error designed by errorCode
CollabMSGraphClient.GrantSharingLinkResponseData
Signature
global class GrantSharingLinkResponseData
CollabMSGraphClient.GrantSharingLinkResponseData Properties
CollabMSGraphClient.GrantSharingLinkResponseData ConstructorsGrantSharingLinkResponseData(parser)
Signature
global GrantSharingLinkResponseData(JSONParser parser)
GrantSharingLinkResponseData()
Signature
global GrantSharingLinkResponseData()
CollabMSGraphClient.GraphErrorResponse
Class to wrap the errors
Signature
global class GraphErrorResponse
CollabMSGraphClient.GraphErrorResponse Properties
CollabMSGraphClient.GraphErrorResponse ConstructorsGraphErrorResponse(parser)
Signature
global GraphErrorResponse(JSONParser parser)
GraphErrorResponse()
Signature
global GraphErrorResponse()
CollabMSGraphClient.Link
Signature
global class Link
CollabMSGraphClient.Link Properties
CollabMSGraphClient.Link ConstructorsLink(parser)
Signature
global Link(JSONParser parser)
CollabMSGraphClient.ParentReference
reference to the parent
Signature
global class ParentReference
CollabMSGraphClient.ParentReference Properties
CollabMSGraphClient.ParentReference ConstructorsParentReference(parser)
Signature
global ParentReference(JSONParser parser)
ParentReference(driveId, path)
Signature
global ParentReference(String driveId,String path)
CollabMSGraphClient.SaveFileResponse
Response info after saving a File to SharePoint
Signature
global class SaveFileResponse
CollabMSGraphClient.SaveFileResponse Properties
CollabMSGraphClient.SaveFileResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
Returns
whether there is an error
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
Returns
whether there is a specific error designed by errorCode
CollabMSGraphClient.SendEmailResponse
Signature
global class SendEmailResponse
CollabMSGraphClient.SendEmailResponse Properties
CollabMSGraphClient.SendEmailResponse Methods
isError()
checks if there is an error present
Signature
global Boolean isError()
isError(errorCode)
checks if there is an error with a certain error-code present
Signature
global Boolean isError(String errorCode)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||