rival-black
rival-black•3mo ago

Token Refresh via API

Hello, I am limited to calling your rest API as I am in C# SemanticKernel. I can execute tools ok but once the token for tool expires I am geting 401 and I am not sure how to CORRECTLY refresh it. I found some thread that said the Composio tool handles refreshing tokens. But I canot call this tool via API execute action endpoint right (at least I couldnt due to some odd errors about api key missing)? Workaround for now is DELETE connection and INITIALZE again for the connected account that receives 401 but this does not sound very good to me. Can you suggest how to handle token refreshing in API only scenarios (so no client library available)?
12 Replies
sensitive-blue
sensitive-blue•3mo ago
hey @Patryk - we handle the refresh tokens by default. there seems to be an issue with the tool you're using. can you share which tool you are using?
rival-black
rival-blackOP•3mo ago
Tool is dropbox - I can create a file ok but after some time I start getting 401 - this then works again if I recreate connection. I use DROPBOX_UPLOAD_FILE to create simple test file in root of dropbox for the user also if it helps - UI shows the connection still as ACTIVE after this 401 (not sure if this is correct or should it show as FAILED ?)
sensitive-blue
sensitive-blue•3mo ago
We found the issue, and a fix will be pushed soon. I'll let you know here as soon as it's fixed.
rival-black
rival-blackOP•3mo ago
Fantastic, thank you soo much 💪
sensitive-blue
sensitive-blue•3mo ago
yes - right now we are not handling this issue but we're fixing this in the next release.
rival-black
rival-blackOP•3mo ago
any eta on the next release by any chance? Is it days, weeks?
sensitive-blue
sensitive-blue•3mo ago
mostly before this weekend.
rival-black
rival-blackOP•2mo ago
has this been released by any chance?
ambitious-aqua
ambitious-aqua•2mo ago
I also get this with my linkedin integration
xenial-black
xenial-black•2mo ago
Are you still getting that issue @Patryk @pinkponk ??
ambitious-aqua
ambitious-aqua•2mo ago
unsure, have worked on other stuff. Will get back to you if/when it happens again. Problem is that it only happens when the token expires, e.g. a linkedIn token takes 2 months to expire. So we will see in 2 months 😛 I can see this on the old account so I guess you now identify the expire at least (screenshots) So I dont get the expired connected accounts using the api. Should the logic be that if one cannot find a connected account then one needs to create a new? or is there a reuse strategy? @thatsmeadarsh
No description
No description
xenial-black
xenial-black•2mo ago
Yes, you can always create an new connection

Did you find this page helpful?