Get public URL through API
Hi, Im using the Share interface to get a public link for anonymous user. However, the same file is repeated, and I can't see all files in a folder.  Is there a better way to share a link with the API??

  • On 7/19/2021 at 1:39 PM, Vanessa Madriz said: Hi, Im using the Share interface to get a public link for anonymous user. However, the same file is repeated, and I can't see all files in a folder.   Is there a better way to share a link with the API??   Hi Vanessa,   You can create shares through most of our tools to one file, multiple files, or entire folders. You can also configure those shares to only link to the specific items selected at that time, or to link to the current version of those items so it stays up to date when new versions are created or files are added to the folder.   If you wish to do the same via API, you would need to make a POST request using  the endpoint /sf/v3/Shares and include a payload similar to that listed below. If UsesStreamIDs=true then it will always link to the current version of the items and false would only link to the version shared at that time. If specifying this value as true then for Items.Id=itemidORstreamid you would need to use the items Steam ID rather than it's standard item ID.  Stream IDs will always start with ST for both files and folders, but when referencing a specific version of items then the item ID of folders will always start with FO and files will start with FI.{'ShareType':'Send','ShareAccessLevel':'Anonymous','ExpirationDate':'0000-00-00T00:00:00.0000','MaxDownloads':-1,'IsViewOnly':false,'UsesStreamIDs':true,'Settings':{'NotifyOnUse':true},'ShareAccessRight':{'odata.type':'ShareFile.Api.Models.ShareAccessRight','DisplayText':'have full control','AccessRightType':'FullControl','odata.metadata':'https://subdomain.sf-api.com/sf/v3/$metadata#ShareAccessRights/ShareFile.Api.Models.ShareAccessRight@Element','Id':'','url':'https://subdomain.sf-api.com/sf/v3/ShareAccessRights()'},'Items':[{'Id':'itemidORstreamid}]} More details on using API with shares can be found here: https://api.sharefile.com/docs/resource?name=Shares
This question is closed.