Skip to main content

HI All, I’m looking at taking advantage of the Json Import features that was added last year to create some diagrams programatically. I’ve gotten to the point I should be able to import, but I’m getting 403 errors. Could someone help me figure this out? 

 

curl 'https://api.lucid.co/documents'\
--request 'POST'\
--header 'Authorization: Bearer <TOKEN>'\
--header 'Lucid-Api-Version: 1'\
--form 'file=@./network.lucid;type=x-application/vnd.lucid.standardImport'\
--form 'title=New Document'\
--form 'product=lucidchart'\
--form 'parent=1234'
{"code":"accessForbidden","message":"Access to this resource is forbidden","requestId":"2cee5d6383fdcfac"}%

 

 

I’m trying to import the example from here… https://github.com/lucidsoftware/sample-lucid-rest-applications/tree/main/standard-import/demo-files/network

 

 

Hi ​@Markeen 

 It's likely due to insufficient permissions in your API token or attempting to access a restricted resource, such as a folder. Kindly check that your OAuth token includes necessary scopes like "document:write" and "user:read" in the Lucid developer portal.

Besides try removing the "parent" field from your API call to test if the issue persists. Ensure you're using the correct product parameter ("lucidchart") and that your Lucid account has API-enabled permissions.

To learn more - Newbie question doing my first API call - 403 response | Community

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards


Thanks ​@Humas1985 . Is this the appropriate way to set the scopes? 

 

https://lucid.app/oauth2/authorize?client_id=<CLIENT_ID>&redirect_uri=https://lucid.app/oauth2/clients/<CLIENT_ID>/redirect&scope=lucidchart.document%20offline_access%20user.profile

That doesn’t seem to be working for me. 

 

Is there a definitive list of all the scopes needed for a json import? 

 

My original scopes were:

 

  "scopes":  
"lucidchart.document.content",
"offline_access",
"user.profile"
]

 


Nevermind. The issue was the parent. Thanks!


Reply