Question

Error with Embed Rest API

  • 10 January 2024
  • 7 replies
  • 103 views

Badge +1

I’m getting an error while trying to embed a Viewer iFrame using the REST API. “Our servers experienced an error. We apologize for the inconvenience.

 

I send a POST to https://api.lucid.co/embeds/token with no embedId, just the origin in the body and the bearer token in the header per the documentation here: https://developer.lucid.co/rest-api/v1/#generate-embed-session-token60

 

I get back a Session Token in the body of the response and then set this as my iFrame source:

https://lucid.app/embeds?token=:token where :token is replaced with the response from the POST and get the below error. This was working previously but stopped working at some point, I think in December. I believe it is also not working when there is an embedId but haven’t had a chance to retest that.

 

 


Comments

Badge +1

Hello Ben, thank you for reaching out regarding the embed error you are seeing.  We are currently investigating and will be in touch as soon as possible.

Badge +1

Can you double check that the user who is logged into “lucid.app” is the same user who granted the OAuth2 User Token which was used to generate the embed token via the “/embed” endpoint?  I am seeing an error for your request where `Token user and logged in user mismatch`.

 

Its possible that error is a side effect of the actual problem, but let me know what you find. In the meantime, I’ll continue investigating.

Badge +1

Hi Michael,

 

Thanks for looking into this. I just created a new token and it is now working. I am 99% sure that the token I was using before was created in exactly the same way though so am confused on why I’m getting different behavior and why the old one was working for some functionality but not others. Having it working is nice though!

My one thought is that somehow the token is getting messed up in the refresh token process, I just refreshed it though and it still works. I’ll try again later or tomorrow to be sure.

As a side note, I realized that the client id I gave you on our earlier call was incorrect, we’re using a different one which is under Admin > General app integration > Oauth apps > Oauth 2.0. I think we maybe just used a different means of creating it, but wanted to flag that in case it means anything on the backend. 

Thanks for your help, I’ll keep testing but glad to see it working at the moment.

 

Badge +1

That’s great to hear it is working now!!  I’ll look into the user refresh issues and try to pin down any failures. OAuth2 refreshing is sensitive, so we want to ensure its always working correctly. I am also glad to hear the clientId you gave me was wrong.  I couldn’t find references to the one you gave me with that endpoint and I was worried our tracking wasn’t correct.

Let us know any other issues you have. Glad to help.

Badge +1

@Michael B101 - I’m getting a different but strange error again, it was working yesterday but not today. I’m logged in with my user in the UI, authenticated via OAuth, and am getting this error from Brave browse:

The login link doesn’t seem to do anything and it doesn’t make sense that I’d need to login when I already am.

And this from Chrome:

 

You mentioned seeing some error before “Token user and logged in user mismatch” - any thoughts on how that could happen? It seems related to this but I’m not sure how it’s possible

Badge +1

For Brave, I am wondering if its a third-party cookie issue. That would explain why it thinks you are not logged in.

 

But, that wouldn’t explain Chrome. I am investigating now.  Did you generate a new oauth2 token, or refresh the previous one?

Badge +1

Thanks Michael. I created a new token and tried it right away.

Reply