UiPath Box Connector

Hi @Silviu sir,

I have a requirement wherein I have to upload/download/move files in BOX. I am using the UiPathTeam.Box.Activites . I have followed all the steps mentioned in the document to grant access to the app created in BOX but when i run the workflow i get a error:-Box Scope: One or more errors occurred.
I have all the details like Client ID, Client Secret.I put in the redirect url as UiPathIntegrationApp. I get the authorization code and put it in the scope and try to get refresh token but it fails.
Could you please help me with this. Let me know if you need any other information.

Thanks

PFB the image of my workflow

Hi @asinhaP,

Your workflow looks ok from the picture you posted.
I tried it myself with the OAuth 2 authentication and for my first attempt I got the same error “One or more errors occurred”. I generated another authentication code (steps 5-7 from the documentation), replaced it in the workflow and it worked fine. I don’t know why the first time it did not worked, but the authorization code is valid only once, so you need to generate another one if you get an error.

Can you generate another authorization code and try again?

Best regards
Silviu

Thanks @Silviu
I retried it and it worked. I think the trick behind be the validity of the token after which it expires.

1 Like

Hi @Silviu,

I have noticed that the box scope gives error after every few min and I have to regenerate code and token. Is this expected or do we have workaround this?

Thanks,
Ashish

Hi @asinhaP,

Once you have the Refresh Token (after using the Authorization Code) it is valid for 30 days, if I remember correctly, but it can be used only once. Meaning that when you use the Refresh Token to authenticate in the Box Scope, a new Refresh Token is generated. Next time you should use the new Refresh Token.

You can do that by saving the Refresh Token in an Asset / Config / Text File.

Here you have an example on how to do that:

  1. Uses the Authorization Code to generate a Refresh Token.
  2. The Refresh Token is stored in a text file.
    It is done manually but should be necessary only first time and if the last generated Refresh Token expired (not used for more than 30 days).
  1. Get the Refresh Token from the text file.
  2. Authenticate to Box Scope using the Refresh Token.
  3. The output of Box Scope - Box Client is stored in a variable and it is used for all subsequent Box Scope activities. It can be also sent as input argument for Invoke Workflow.
  4. After the last Box Scope activity we need to save the Refresh Token into the text file.

This is so helpful. I was trying the same thing. I was going through all the documentatio of BOX API and Python SDK and I found the similar thing as you mentioned about the validity. Thank you so much @Silviu. I really appreciate it.

Ashish

1 Like