Would be cool to see the Space ID for journals be predictable somehow.
I use the Shortcut @ethan (I think) made to send stuff to an Inbox space, but if the journal space IDs were predictable, I could build that logic into the shortcut and be able to send stuff to the current day’s space with the Shortcut.
I’m thinking it could still start with a random, but consistent, string for every user, but end with a consistent “20211024”.
So sjdfksdfksdfss20211024 and sjdfksdfksdfss20211025, etc.
all ids (spaces, cards, connections etc.) are generated by the nanoid lib (https://www.npmjs.com/package/nanoid) , for technical reasons the whole point of it is unpredictable/unique.
how much of your daily journal uses premade cards/prompts? If you’re not using those, you can create a seperate script to POST create a new space that’s marked as being a journal by setting moonPhase (see https://help.kinopio.club/api/#spaces for list of possible string values).
Then using the returned space id for adding cards to
what do you think about allowing certain magic names of the body of a /card POST? So setting spaceId to today would create a journal space if it doesn’t exist or add to the existing one if it does.
One problem is that only the client can fully create a journal space with all your prompts in the right location and the moonphase because that’s currently the only place that logic lives. But I can at least just do the moonphase, day card in there
The second issue is I’m not sure I’m a fan of magic/non-conventional anything in an API because it’s not something that other people will easily discover. Also I think the whole REST-y ness of the API works best when a route does a single job.
It might be clearer/more maintainable to have distinct routes to
GET the journal space for today if it exists,
and another route to POST create a journal space for today
Oh yeah, that’s way better. It might make it harder for little shortcut scripts that are simple single calls to the API, but this is much cleaner and easy to understand.
I’m not sure that would really work for Shortcuts on iOS because I’d still have to manually update the space id in the shortcut myself everyday, but it’s not a big deal.
I can add a GET with my auth and then use whatever I receive as a variable to replace the spaceid in the POST above, but I’m not sure how to get the spaceid for the current days space…