Solved

AccessForbidden

  • 12 January 2024
  • 10 replies
  • 162 views

Badge +1

Hello,

 

I am trying to create a script that would export all files in the Lucid platform as an image file, however I am getting the following error message when trying to call the api below. The interesting part is though, I don’t get this error message if I have opened the file in a browser prior to using the api.  Is this a bug or is it something I am not doing. 

api:
https://api.lucid.co/documents/03682f3d-7947-41d5-bd3c-1ea6e66f68b5
response:

{
"code": "accessForbidden",
"message": "Access to this resource is forbidden",
"requestId": "42f57773fbf39c50"
}


Thank You, 
Bereket 
Redhat Inc. 

icon

Best answer by Ian Baenziger 16 January 2024, 20:14

View original

Comments

Userlevel 3
Badge +3

Hi Bereket! Thanks for reaching out. Two questions to help us diagnose:

  • Do you have at least view access to that document? (sounds like you do if you’re opening it in the browser)
  • Could you share the scopes you requested when making an OAuth token?

Thanks! 

Badge +1

Hi Ian, 

For your first question: I am an admin and I can access all the files that the api is failing to export. 

Here is the scopes I requested. 
lucidchart.document.content:readonly+lucidscale.document.content:readonly+lucidspark.document.content:readonly+offline_access+user.profile

Badge +1

Hi Ian, 

Any luck founding out what might be going wrong with the api I am trying to call?

Thank you

Userlevel 3
Badge +3

Hi Bereket! Today is a US holiday, so the US Lucid office is on vacation today. I’ll respond tomorrow. I got a hunch or two, but want to check with the team first.

 

Thanks!

Ian

Badge +1

Oh, My apologies Ian. Thanks for letting me know. 

Userlevel 3
Badge +3

No worries Bereket!

 

You have the right scopes. Here is where I think the issue is coming. In the UI, admins are able to open/view any document on their account, even if they have not been added as a collaborator. This is a special privilege granted in the UI only. In the API, Admins can only interact with documents they have been directly added as a collaborator to. 

 

Try your API call on a document you have been added as a collaborator to. Does that work?

 

Note when I say “you’ve been added as a collaborator”, I mean that you show up under “collaborators” in the share modal in the UI (you open this by clicking “share” on a document in the upper right hand corner).

Badge +1

Hey Ian,

It looks like It works properly when trying to access files I create myself. but files created by others, I can’t seem to access them unless I open the files in browser prior to calling the api. 

Badge +1

Hey Ian, 

Lucid is being decommissioned from our company(Red Hat Inc.) very soon, and I have a limited timeframe to develop the correct script for exporting all the documents from Lucid to our file system so that users can access those files after the decommissioning date. Given the time sensitivity of this task, I was hoping we meet in a quick Zoom meeting to ensure we can collaborate efficiently and address this issue as soon as possible. 

Thank you in advance. 
Bereket 

Userlevel 3
Badge +3

Let’s meet. Please email me at ibaenziger@lucidchart.com and we can figure out a time.

Badge +1

I have emailed you. Thank you. 

Reply