I had to laugh at this, because I'm also running into the same issue.
Their customer support told me I can get a token on the website at "dev tools -> application -> cookies -> jwtToken", but I'm not finding a "dev tools" section anywhere on the website dashboard or in my settings.
I'm waiting to hear back from them with further clarification, and will let you know what I find out!
The macro has been working well, except that every week or so it would suddenly stop working. I figured out it was because my token had changed. Once I grabbed the new token and inserted it into the script, the macro started working again, at least until the token would change once more.
I reached out to Droplr and asked why this was happening, and they responded:
"Just to clarify, our tokens typically have a one-week expiration period as part of our standard procedure. When you make a request, a new token is returned in the headers. The header you're looking for is 'x-droplr-authorization.' This header is sent with each request, providing a new token automatically. Utilizing this header will allow you to refresh your token as needed."
Based on what he wrote, do you have any ideas on how the script and/or macro can be updated to accommodate for this?
I took a look at it and, yes, it's possible. You send a request with a valid token and you receive a new token which is valid for one week. So, if you use the macro every day or at least once during the week (before the token expired), you receive a new token and the macro works again for at least a week. We therefore need to use a variable to store and use this new token for the next request. However, if you exceed this period of time, you'll have to go back and get a valid token by connecting to the site and looking for it in the cookies to encode it in the variable. I need a bit of time to check the error messages we get when the 7-day period has expired so that I can build a macro that's as clear and clean as possible so that everyone can understand and use it. And to see how I can deal with the fact that the 'token' variable exists the first time it's used.
Give me a few days and I'll come back with a new macro ready to use.
Maybe one approach would be to create an additional separate macro that, once a day, pings Droplr to retrieve an updated token, which it then saves to the variable you mention? That way, you'd just about always have a fresh token, even if you haven't used the original macro in awhile.
The only scenario where you'd then have an invalid token would be if, say, your computer has been off or disconnected from the internet for seven days. (And in the uncommon scenario that this happens, there can be an error message that explains to the user how to retrieve a new token from the Droplr website, and that also then provides a method for manually updating the variable to this manually retrieved token.)
An even better solution, if at all possible, would be to have the "daily token refresh" script run on the web. That way you'd always have a fresh token available, even if your computer has been shut down and disconnected from the internet for an extended period. Though that might involve using services beyond Keyboard Maestro.
Yep! Then, the only scenario that wouldn't be covered would be if your computer is shut down or disconnected from the internet for over seven days. (Though maybe there's a way to run the script from the web, and not the computer, so that this wouldn't be an issue.)
I have been following this thread since the Droplr app has changed significantly, breaking some of my workflows.
I have found this resource: GitHub - Droplr/droplr-js: Official Droplr API Client for Javascript, but I do not know if it can help with this issue. I am not very knowledgeable in node.js, so I am unsure how this could be implemented with KM.
I'm not really an expert in Node.js but I've already used some packages. I installed 'droplr-api' but the Terminal told me about a serious vulnerability linked to Axios, a dependency of 'droplr-api'. The last update of the package was more than 6 years ago. So, for something I don't really need (I'm just trying to help @alexcr with a macro for Droplr), I prefer not to use it.