Create folder with specific id

I came across a few issues when I was about to write a plugin.

First I wanted to let users specify the folder id, since names are not unique, but then I've noticed there's no way to actually get the folder id from the Joplin UI. Thus people can't enter (copy/paste) a folder id.

Then I thought I could work around it by creating a folder with a specific id, and then people could rename and move the folder however they please.
But here's the next problem: I cannot create a folder with a specific id. At least not that I can see. The plugin api says it's based on the rest api and there it's not possible.

Another thing which seems to be impossible is to create a folder with name XYZ and retrieve the id of that created folder. The post method does not return an object. Or at least I can't see that in the docs.
Once again, if there's already a folder called XYZ, a subsequent search for XYZ to retrieve the id could return the wrong folder.

So now I'm stuck. With neither of those 3 things, I can't create the plugin. Or at least the result would be undefined.

Does anyone have an idea how to proceed?

Filter by created_time?

Yes, this could work. I thought about it, but hoped for a "better" solution.

IMO an API request/call should return an object. Or return the id on success. Because with the id you can then get everything else.

For consistency the API should also allow to specify the id for folders. It is possible for notes. Why not for folders?

@laurent I'd like to follow up on this topic.

Is there a reason why this is missing for folders? Would you accept a PR for the API that adds the possibility (optional) to specify an id when creating a folder? (Same as for a note.)

Specifying a static ID is almost always a bad idea I think. If a plugin does that, it will break sync when the user install the same plugin in a second client.

However when you create a folder it should respond with the folder object and a number of properties, including the ID. Is it not working at the moment?

Nope, nothing is returned when creating a folder. At least there wasn't 4 months ago. I will check again.

Before using the data api, some basic data was returned, but I have never tried the plugin data api. . .


Do you still have the code you were using?

Nope, but I'm off work starting Wednesday until the end of the week. (I will write a small snippet for testing.)

Right now I'm trying not to die of heat exhaustion. I woke up to 28.5 degrees in my room and 79% humidity. It's almost 9pm and even though my AC is running it has 27 degrees in my living room. This is freaking insane.

But with 35 degrees it's definitely better than the west coast. B.C. had 46 degrees yesterday.

Yeah, my friends overseas think we live in igloos up here until they actually bother to check the weather. Our airconditioning was still running at 3 am!

I just moved to Victoria this weekend. It was around 34° in my apartment all day. It's supposed to be better from tomorrow onwards. I'm regretting choosing this weekend to move.

I'm actually surprised you have AC in Canada. I would have thought it's like in the UK, rarely hot enough to justify installing one.

Haha you proved my point Laurent :grinning_face_with_smiling_eyes: When we moved to our new house in British Columbia the first thing we did was have air conditioning installed. I don't think we would have survived without it... But yeah this past week has been exceptional for sure.

And sorry for detailing your thread Tessus but it's such a "hot" topic around here :sweat_smile:

I wish. Unfortunately that has been a pipe dream on my side ever since I moved here.

Canada has everything from perma-frost to semi-desert. And we don't really have seasons. IMO it switches almost directly from winter to summer with maybe a week or two transition period. Not much difference in the fall.

While other parts have dry heat/cold, it's usually humid in Toronto, which makes it even more unbearable. I love the winters in Toronto. Except the people that drive with summer tires, but it's usually rather "warm" compared to other parts of Canada.