Invalid value 'd_xxxxxxxxxxx1'. 'parent' with value 'd_xxxxxxxxxxx1' not found

Highlighted
New Contributor

Invalid value 'd_xxxxxxxxxxx1'. 'parent' with value 'd_xxxxxxxxxxx1' not found

Hi,

We are performing box JWT integration with sub_type='enterprise'. Now we want to upload the file in a folder as a another user. The user is owner of the folder. Setting userId as "req.addHeader('as-user','*******');"

Below is the request I am posting :

blob base64EncodeFile=base64EncodeFileContent(uploadContent,uploadFilename);
String uploadEndPointURL='https://upload.box.com/api/2.0/files/content?parent_id='+selectedFolder;
String boundary = '----------------------------741e90d31eff';
HttpRequest req = new HttpRequest();
req.setBodyAsBlob(base64EncodeFile);
req.setHeader('Content-Type','multipart/form-data; boundary='+boundary);
req.setHeader('Content-Length',String.valueof(req.getBodyAsBlob().size()));
req.setHeader('Authorization', 'Bearer ' + accessToken);
req.setHeader('as_user', '********');
req.setMethod('POST');
req.setEndpoint(uploadEndPointURL);
req.setTimeout(120000);

 

Also Below is the screenshot of the app configuration. We also tried with generate token enabled but it was not helpful.

 
 

Box setting.PNG

 

Thanks