Skip to main content

Preview error on Content Explorer Widget

  • Aug 8, 2023 5:59 AM UTC
  • 7 replies
  • 556 views
  • Translate All
Preview error on Content Explorer Widget

I am getting the following error while previewing a file.

The error message says, The document may be protected, but I am able to preview the same if i use a new downscoped token.

Form network tab, It seems when we click on preview, it tries to download the resource, but the resource is not found.
image

When I tried hitting the same API in postman. I got the following response.

This happens when I try to preview a documents after some interval of 10-15 minutes. Is there a solution available to explain the underlying cause of this behavior?

7 replies

  • Author
  • Known Participant
  • Aug 9, 2023 10:12 AM UTC

Steps to reproduce the above issue:

  1. Create a downscoped token with the following scopes.
    base_explorer, item_preview, item_download, item_upload
  2. Use the generated token in the Content Explorer widget.
  3. Preview a file 3-4 times.
  4. Wait for 15-20 minutes
  5. Preview the same file again. (The above error appears on the widget.)
Translate

rbarbosa Box
Forum|alt.badge.img
  • Developer Advocate
  • Aug 9, 2023 4:15 PM UTC

Hi @Niladri ,

Downscope tokens do not automatically renew, not even via the SDK’s, however I would expect the token to be live for 60 minutes and get a 403 if expired, not a 404.

I’ll ask my team about this case too.

Translate

  • Author
  • Known Participant
  • Aug 9, 2023 4:49 PM UTC

Hi @rbarbosa,

The downscoped token maintains its validity for nearly an hour. Therefore, any potential errors shouldn’t arise until after this 60-minute window has passed. Strangely though, when I reload the page, the Content Explorer displays the file list, confirming the token’s validity. Nevertheless, I encounter problems when attempting to preview the file.

Certainly, I appreciate your willingness to involve your team in addressing this case. Your collaboration is valuable, and I look forward to any insights or updates your team can provide.

Translate

  • Author
  • Known Participant
  • Aug 10, 2023 11:18 AM UTC

The same issue appears on the Content Explorer widget on the box’s Content Explorer documentation website. The behavior is observed specifically while previewing PDF files.

Content Explorer - Box Developer Documentation

Translate

  • Author
  • Known Participant
  • Aug 14, 2023 11:19 AM UTC

Hi @rbarbosa / Team,

Is there any update on this issue?

Translate

rbarbosa Box
Forum|alt.badge.img
  • Developer Advocate
  • Aug 15, 2023 6:05 PM UTC

Sorry @Niladri , not yet… 😦

On a brighter side, you did inspire me to create a UI Elements workshop…

Check it out and send your feedback at:

Cheers

Translate

  • Author
  • Known Participant
  • Aug 17, 2023 9:42 AM UTC

That’s fantastic to hear! I’m really glad to have been an inspiration for your UI Elements workshop. It sounds like a great initiative, especially with the focus on a pure Javascript approach to cater to a wider range of stacks. I’ll definitely check out the Box UI Elements Workshop and provide you with my feedback.

Keep up the great work!

Translate