I am having an issue specifically trying to upload an attachment blob to Egnyte using the REST API. Code is below. Any input is appreciated, I am guessing my POST is missing something but I can't see it.
Attachment att = [SELECT Body FROM Attachment WHERE Id = '00P55000001p7tE'];
String destinationPath = 'pubapi/v1/fs-content/Shared/Salesforce.com/Accounts/Amy%20Test/Opportunities/Amy%20Test%20no%20MgmtCo/Test/test';
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setBodyAsBlob(att.Body);
req.setHeader('Authorization', 'Bearer ' + authResponse.access_token);
req.setEndpoint('callout:EgnyteDerrickCredential/' + destinationPath);
HttpResponse res = h.send(req);
System.Debug(res.getBody());
With response:
18:55:56:582 USER_DEBUG [53]|DEBUG|{"message":"content length do not match with DB object size for workgroupid:65a17409-23cc-4f04-baf6-00f5cbecbb6d and objectId: 157.9c1ce840-b63c-4609-9204-10548c617015 actual size: 0, expected size: 55456"}