I have been checking the documentation for embedding files and it appears that I am supposed to be generating a temporary token that is to be used when embedding files. This is the page I am looking at: https://lucid.readme.io/reference/documentembedstoken
The example curl is:
curl --request POST \
--url https://api.lucid.co/embeds/token \
--header 'accept: application/jwt' \
--header 'authorization: Bearer oauth2-...' \
--header 'content-type: application/json'
This curl seems to be incorrect/missing data, as when I use the example I get the error The requested resource requires a valid Lucid-Api-Version header
. So, I pass this header: Lucid-Api-Version: 1
in the curl (which I am assuming is correct but there is no good way for me to be sure) and I get the error Missing or invalid access token
despite me passing in a valid access token. In addition, the documentation says I need to pass a body, including `origin`, and `embedId` (as optional) which is not included in the example despite `origin` being a required field.
So I change the curl on my side to something like this, but I still get a “Missing or invalid access token” error, though I have confirmed this access token is correct via other endpoints.
curl --request POST \
--url https://api.lucid.co/embeds/token \
--header 'accept: application/jwt' \
--header 'content-type: application/json' \
--header 'Lucid-Api-Version: 1' \
--header 'authorization: Bearer oauth2-...' \
--data '{"embedId":"...","origin":"http://localhost"}'
This seems to be the case for most all documented endpoints, providing an incomplete curl which does not include (required) information included in the documentation. I don’t know if this just is something that isn’t working on LucidChart’s side or if my curl is incorrect, because the documentation seems inconsistent.