I’m trying to create a data connector for getting the documents associated to an account using this endpoint:
https://api.lucid.co/accounts/me/documents/search
But I get a 403 error, so the performDataAction is not fired. Please, what could be wrong?
Extension registered action code:
client.registerAction("getAccountDocumentlist", async () => {
const triggerOauth = await client.oauthXhr("lucid", {
url: "https://api.lucid.co/accounts/me/documents/search",
headers: {
"Lucid-Api-Version": "1",
"Content-Type": "application/json",
},
data: "{}",
method: "POST",
});
console.log("triggerOauth", triggerOauth);
const result = await client.performDataAction({
dataConnectorName: "dataconnector",
actionName: "GetAccountDocumentList",
actionData: { message: "GetAccountDocuments" },
asynchronous: true,
});
console.log(result);
}); -
manifest.json content:
...
"oauthProviders": "
{
"name": "lucid",
"title": "Lucid",
"authorizationUrl": "https://lucid.app/oauth2/authorize",
"tokenUrl": "https://api.lucid.co/oauth2/token",
"scopes": "
"folder",
"lucidchart.document.content:readonly",
"lucidchart.document.content:admin.readonly"
],
"domainWhitelist": "
"https://api.lucid.co"
],
"clientAuthentication": "clientParameters",
"faviconUrl": "https://cdn-cashy-static-assets.lucidchart.com/marketing/images/LucidSoftwareFavicon.png"
}
],
"dataConnectors": "
{
"name": "dataconnector",
"oauthProviderName": "lucid",
"callbackBaseUrl": "http://localhost:3001/?kind=action&name=",
"dataActions": {
"GetAccountDocumentList": "GetAccountDocumentList",
"Poll": "Poll",
"HardRefresh": "HardRefresh",
"Patch": "Patch"
}
}
]
...
I have to add that the lucid.credentials.local contains the correct clientId and clientSecret that have been set in the application declaration OAuth2 tab with the correct Redirect URIs:
https://extensibility.lucid.app/packages/<myAppId>/oauthProviders/lucid/authorized
Best regards.