No or very slow API replies from REST API


Badge +3

I am the developer of an application where we want to show pages from Lucidchart documents into our application. I want to show them by exporting each page as a jpeg file into our application. I created an OAuth 2.0 client and I can get and update a token without a problem. My application is written in PHP.
 

To add the pages our users first search for Lucid chart documents. I use the Search document endpoint for that (https://api.lucid.co/documents/search). I then display the search results where the user can pick a Lucidchart document.

Then, I use the Document Contents endpoint (https://api.lucid.co/documents/:id/contents) to retrieve what pages are in the document. I then loop over these pages to export each page to a jpg image with the Export Document endpoint (https://api.lucid.co/documents/:id?pageId=xxx).

The problems I have, is that many times, the API simply doesn’t answer and times out. I almost never get an error message back from the API. I do sometimes I get a curl error 0 with an error message “SSL connection timeout”.

Am I doing something wrong here? I don’t request that many pages, this is usually less than 10. I think the rate limit shouldn’t be the issue here. Or is it?


Comments

Userlevel 2
Badge

Hi renekreijveld,

Thank you for using our APIs! I agree that the rate limit shouldn’t be an issue, but we haven’t been able to track down the problem yet. Would you mind sending your client ID so we can narrow our search?

Badge +3

Hi!, The client ID is LVpPRq--ckUg5Rldsi7tbauQAzik9NaS6TUVr2aa

Userlevel 2
Badge

Thank you! Digging more into this now

Badge +3

I just did some more tests, and it all seems to work really well now. No hickups.

Userlevel 2
Badge

Glad to hear it! We’re concerned that the problem might still exist somewhere, so if you run into the error again, would you be able to let us know which endpoint the request is timing out on and a rough timestamp of when it happened? We’ll keep an eye out on our end as well. Best of luck!

Badge +3

Hi Trevor, this morning I got two timeouts again. Here is a snippet from my API logging:
 

2024-05-15 09:31:24: POST: https://api.lucid.co/documents/search
2024-05-15 09:36:24:
2024-05-15 09:36:24: Responsecode: 0
2024-05-15 09:36:24: Curl error: SSL connection timeout
2024-05-15 09:51:16: POST: https://api.lucid.co/documents/search
2024-05-15 09:56:16:
2024-05-15 09:56:16: Responsecode: 0
2024-05-15 09:56:16: Curl error: SSL connection timeout

Times are Amsterdam time.

Userlevel 2
Badge

Thank you, this will be very helpful! While we investigate and hopefully fix the connection issues, something you could do to help mitigate the issue is to retry the request when it fails. This has helped others who experienced similar issues.

Badge +3

Yes, that’s what I do now. But I have to mention that the timeouts occur quite often. So our users need to resend requests often which isn’t too user friendly.

Userlevel 2
Badge

Thank you again for reaching out. We are investigating this now as our top priority.

Badge +3

Yesterday I was working all day at my work office location and I haven’t noticed any timeouts at all.

So the problem seems related to my home office location. In my PHP code I have now set these two curl options before the curl call gets executed:

CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,

This seems to improve matters on my development machine when I work at home, as I haven’t seen any timeouts since. I’m confused what could cause the timeout issues when I work at my home location.

Userlevel 2
Badge

Great, thank you for the addition information. We will let you know when we find any answers.

Reply