Skip to main content
Answer

AccessForbidden

  • January 12, 2024
  • 10 replies
  • 248 views

Forum|alt.badge.img+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. 

Best answer by Ian Baenziger

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
Forum|alt.badge.img+5
  • Lucid product team
  • January 12, 2024

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! 


Forum|alt.badge.img+1
  • Author
  • January 12, 2024

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


Forum|alt.badge.img+1
  • Author
  • January 15, 2024

Hi Ian, 

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

Thank you


Ian Baenziger
Forum|alt.badge.img+5
  • Lucid product team
  • January 15, 2024

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


Forum|alt.badge.img+1
  • Author
  • January 15, 2024

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


Ian Baenziger
Forum|alt.badge.img+5
  • Lucid product team
  • Answer
  • January 16, 2024

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


Forum|alt.badge.img+1
  • Author
  • January 16, 2024

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. 


Forum|alt.badge.img+1
  • Author
  • January 16, 2024

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 


Ian Baenziger
Forum|alt.badge.img+5
  • Lucid product team
  • January 17, 2024

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


Forum|alt.badge.img+1
  • Author
  • January 17, 2024

I have emailed you. Thank you.