What is the API call to create external sharelink for a pdf
Here's my code
- mp = Map();
- mp.put("Accept","application/vnd.api+json");
- // Parameters Map
- externalLinkMap = Map();
- externalLinkMap.put("resource_id",resource_id);
- externalLinkMap.put("link_name","link");
- externalLinkMap.put("request_user_data",false);
- externalLinkMap.put("allow_download",true);
- // Give view-only access
- externalLinkMap.put("role_id","34");
- attributesMap = {"attributes":externalLinkMap,"type":"links"};
- dataMap = Map();
- dataMap.put("data",attributesMap);
- // Create external share link
- external_link_data = invokeurl
- [
- url :"https://www.zohoapis.com/workdrive/api/v1/links"
- type :POST
- parameters:dataMap.toString()
- headers:mp
- connection:"workdrive_all"
- ];
The connection has the correct scope(s).
The error message is
- {"errors":[{"id":"R008","title":"Unauthorized access"}]}
I know the code works for native Zoho document types such as a sheet.