Skip to main content
Jan 12, 2024 10:02 PM UTC
Solved

AccessForbidden

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. 

Ian Baenziger
Lucid product team
Jan 16, 2024 7:14 PM UTC

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).

Comments

Ian Baenziger
Lucid product team
Jan 12, 2024 10:23 PM UTC

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! 

Translate
blibanosAuthor
Jan 12, 2024 11:52 PM UTC

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

Translate
blibanosAuthor
Jan 15, 2024 4:38 PM UTC

Hi Ian, 

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

Thank you

Translate
Ian Baenziger
Lucid product team
Jan 15, 2024 10:26 PM UTC

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

Translate
blibanosAuthor
Jan 15, 2024 10:45 PM UTC

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

Translate
Ian Baenziger
Lucid product team
Jan 16, 2024 7:14 PM UTC

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).

Translate
blibanosAuthor
Jan 16, 2024 8:17 PM UTC

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. 

Translate
blibanosAuthor
Jan 16, 2024 10:25 PM UTC

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 

Translate
Ian Baenziger
Lucid product team
Jan 17, 2024 12:04 AM UTC

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

Translate
blibanosAuthor
Jan 17, 2024 6:40 PM UTC

I have emailed you. Thank you. 

Translate