CreateLink Method
Creates a resource sharing link.
Syntax
ANSI (Cross Platform) char* CreateLink(int bReadOnly); Unicode (Windows) LPWSTR CreateLink(BOOL bReadOnly);
- (NSString*)createLink:(BOOL)readOnly;
#define MID_ONEDRIVE_CREATELINK 7 IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_OneDrive_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);
Remarks
This method creates and returns a sharing link for the resource currently selected by RemoteId or RemotePath. The ReadOnly parameter controls whether the link provides view-only or editing access to the resource in question.
For OneDrive for Business and SharePoint Online resources, the CreateLinkScope configuration setting can also be used to control the access scope used to create the link.
// Create a read-only shared link for the given file. onedrive.RemotePath = "/work_stuff/serious_business/best_cat_pictures.zip"; string sharingUrl = onedrive.CreateLink(true);
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.