• Sumant Kuchi 4
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi, I recently stepped into SF and working on BOX integration.
Here are the scenarios I used for Box integration.
1) Downloaded box app from appExchange and used two box accounts to setup (I have no clue why do we need user account for developing)
2) followed the instructions what document given.
3) Was uploaded files in box section of an object
But this solution is not sufficient since eveyuser is asked login to grant permissions to create folder

Scenario 2:
1) Downloaded box app from appExchange and used two box accounts to setup (I have no clue why do we need user account for developing)
2) Created custom object which resembles the Attachment object that will replace the standard attachments related list on the page layout.
3) Created VF for file upload page and Controller for that page
4) In the Controller I'll be able to attache files to SF File Storage but I'll not be able to upload to BOX, here is the error and code to box I used.
Error:

13:24:15:149 USER_DEBUG [19]|DEBUG|Toolkit:[AUTH_WRAPPER_PREPARE_FAIL_MESSAGE=Unable to use default credentials to make a callout to box (maybe this is in a trigger or constructor): , authWrapper=BoxAuthWrapper:[adminSettings=box__BoxUser_Settings__c:{}, client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, client_secret=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, redirect_uri=null, resultMessage=, userSettings=box__BoxUser_Settings__c:{}], didAuthChange=false, existingFolderId=null, mostRecentError=, newFolderMetas=(), newFrups=(), newRootFolders=()]



Note: I replaced client_id and client_secrets with x and y respectively
and the box toolkit code I used to upload file..
 
//@future (callout=true)
    private void createAttachmentinBox(id attachmentid){
        System.debug('In HelperClass');
        String BoxFolderid='11476443045';
        box.Toolkit boxToolkit = new box.Toolkit();
        System.debug('boxtoolkit'+boxToolkit);
        Attachment Myattachment=[select name,body,parentid from attachment where id=:attachmentid];
        System.debug('Attachment '+Myattachment);
        String fileFromBoxID=boxtoolkit.createFileFromAttachment(Myattachment,null, BoxFolderid,null);
        System.debug('fileFromBoxID '+fileFromBoxID);
        boxToolkit.commitChanges();
        //delete [select id from Attachment where id=:attachmentid];
    }
Why am I not able to use default credentials to make a callout to box? Could you get me solition for my issue?

I would be appreciated if you could get me solution







 
Hi, I recently stepped into SF and working on BOX integration.
Here are the scenarios I used for Box integration.
1) Downloaded box app from appExchange and used two box accounts to setup (I have no clue why do we need user account for developing)
2) followed the instructions what document given.
3) Was uploaded files in box section of an object
But this solution is not sufficient since eveyuser is asked login to grant permissions to create folder

Scenario 2:
1) Downloaded box app from appExchange and used two box accounts to setup (I have no clue why do we need user account for developing)
2) Created custom object which resembles the Attachment object that will replace the standard attachments related list on the page layout.
3) Created VF for file upload page and Controller for that page
4) In the Controller I'll be able to attache files to SF File Storage but I'll not be able to upload to BOX, here is the error and code to box I used.
Error:

13:24:15:149 USER_DEBUG [19]|DEBUG|Toolkit:[AUTH_WRAPPER_PREPARE_FAIL_MESSAGE=Unable to use default credentials to make a callout to box (maybe this is in a trigger or constructor): , authWrapper=BoxAuthWrapper:[adminSettings=box__BoxUser_Settings__c:{}, client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, client_secret=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, redirect_uri=null, resultMessage=, userSettings=box__BoxUser_Settings__c:{}], didAuthChange=false, existingFolderId=null, mostRecentError=, newFolderMetas=(), newFrups=(), newRootFolders=()]



Note: I replaced client_id and client_secrets with x and y respectively
and the box toolkit code I used to upload file..
 
//@future (callout=true)
    private void createAttachmentinBox(id attachmentid){
        System.debug('In HelperClass');
        String BoxFolderid='11476443045';
        box.Toolkit boxToolkit = new box.Toolkit();
        System.debug('boxtoolkit'+boxToolkit);
        Attachment Myattachment=[select name,body,parentid from attachment where id=:attachmentid];
        System.debug('Attachment '+Myattachment);
        String fileFromBoxID=boxtoolkit.createFileFromAttachment(Myattachment,null, BoxFolderid,null);
        System.debug('fileFromBoxID '+fileFromBoxID);
        boxToolkit.commitChanges();
        //delete [select id from Attachment where id=:attachmentid];
    }
Why am I not able to use default credentials to make a callout to box? Could you get me solition for my issue?

I would be appreciated if you could get me solution