momijizukamori: Grey tabby cat with paws on keyboard and mouse. The text reads 'code cat is on the job', lolcats-style (CODE CAT)
Cocoa ([personal profile] momijizukamori) wrote in [site community profile] dw_dev2017-10-10 10:29 pm
Entry tags:

API wishlist?

So my workplace gives us a chance twice a year to work on anything we want for a few days, work-related or otherwise, and I thought I'd use some of my time to actually get the new API into a state where we can make it live. With that in mind! What endpoints would you like to see implemented? We're making this Swagger/OpenAPI-compliant, so everything takes JSON as arguments and return JSON formatted data. Stuff already on the list to do or partially done:

/api/v1/users/{username} - GET, shows info about the user (specific info TBD; subset of profile, probably?)
/api/v1/users/{username}/icons - GET, lists icons
/api/v1/users/{username}/icons/{iconid} - GET, returns icon data
/api/v1/users/{username}/journals - GET, returns list of journals with write access.
-- for now, returns only user's primary journal
/api/v1/journals/{username}/accesslists - GET, list of access lists for journal
/api/v1/journals/{username}/tags - GET, list of tags for journal
/api/v1/journals/{username}/xpostaccounts - GET list of xpost accounts
/api/v1/moods - GET list of moods
/api/v1/commentsettings - GET list of allowed comment settings
/api/v1/journals/{username}/entries - POST new entry, GET list of recent entries
/api/v1/journals/{username}/entries/{id} - POST edit entry, GET specific entry
/api/v1/journals/{username}/files - POST new file
/api/v1/spec - GET, returns a description of the API

(Mark and D, as usual, get the final say - some stuff people want may end up being security/privacy risks in non-obvious ways)
green_knight: (Eeek!)

[personal profile] green_knight 2017-10-13 08:00 am (UTC)(link)
Yikes. (That must have been before my time, so over a decade ago, but that sounds like a spectacular failure.)

ironymaiden: (Default)

[personal profile] ironymaiden 2017-10-13 02:18 pm (UTC)(link)

Understood. I would happily pay for push notifications.

[personal profile] casimirian 2017-10-13 06:26 pm (UTC)(link)
Woah, so many comments.

This is great news, since some code I used in the past no longer seems to work for dw-free.

Thank you for taking this initiative. I wish you the best of luck!

Where will you make the code available?
Edited (forogt a word) 2017-10-13 18:26 (UTC)
siderea: (Default)

[personal profile] siderea 2017-10-13 07:00 pm (UTC)(link)
♥!

So, I'll just add this, while asking for the moon:

/api/v1/journals/{username}/grants - GET returns the list of usernames that username (actually {journalname}) grants access to – and if {username} has that public on their profile, you don't have to be authenticated to the API to get it.

Because I think – not sure, but I've thought cursorily through this – that's the last technical obstacle between here and DW Phone Posts being a viable, commerical third-party service. Not that's I'm promising to start a DW collateral business in my non-existent spare time, but. Just sayin'.

(If there is an unemployed dev ops/sys admin/developer who always wanted her own business, and thinks this might be it, she should shoot me a DM.)
Edited (Tyop.) 2017-10-13 19:00 (UTC)
siderea: (Default)

[personal profile] siderea 2017-10-13 07:08 pm (UTC)(link)
Oh, and! Speaking of asking for the moon:

It would be awesome – and way beyond the functionality of a mere API as presently being conceived – if DW had a settings page that allowed users to create API access keys that granted permissions to an arbitrary subset of DW functionality, so then they could hand the API access key over to a third party, to let that third party act as an agent, with less-than-full control of one's journal.

• A backup service could be allowed to read one's locked posts, but not one's grantors' locked posts, and have no write access at all.

• An automated posting service, e.g. IFTTT, could be allowed to post, but not read or comment at all.

• A design service could be allowed to change one's journal's style, without having any access to locked content, and no other write or read permissions.
kaisa: (Default)

[personal profile] kaisa 2017-10-13 07:30 pm (UTC)(link)
I guess it would depend on how many users are using the app and how often they are set to poll the numbers (how real-time the users want it), and how often the numbers change.. If you have a relatively rarely changing numbers, then polling them often would cause more load than pushing them. Also it might be a good idea to consider that there will probably be clients out there who (somewhat understandably) want to poll way too often to keep the notifications closer to real time. Real time does not matter to me personally, I don't know if it matters to other people.
Edited 2017-10-13 20:39 (UTC)
kaisa: (Default)

[personal profile] kaisa 2017-10-14 07:58 am (UTC)(link)
Investigation is good, and if it turns out that there's a need for this, then just recognizing that the need exists and writing it down is also a step forward.
Edited 2017-10-14 08:00 (UTC)
annathecrow: screenshot from Star Wars: The Phantom Menace. A detail of the racing pod engines. (Default)

[personal profile] annathecrow 2017-10-14 12:54 pm (UTC)(link)
Ohhh, that looks good. I do have some wishlist points:

some specific params for GET /api/v1/journals/{username}/entries:
- number of entries to fetch
- offset (so it's possible to get entries in batches)
- from & to timestamps (to get entries from a specific timeframe)
- fetch posts by tag

/api/v1/comments/{post_id} - GET comments on a post, with these params:
- number of comments to fetch
- offset
- from & to timestamps


Generally, I'm hoping for more "frontend" type of endpoints that would make the public data available for automatization/processing - i.e. backups, import/export. The old LJ API is geared toward content-generating apps, I'd love something more akin to Tumblr's API.

[personal profile] casimirian 2017-10-14 06:06 pm (UTC)(link)
Thanks, Momiji. I added this as a bookmark and will investigate while I'm not studying. I sincerely appreciate the work you're doing!
siderea: (Default)

[personal profile] siderea 2017-10-14 06:47 pm (UTC)(link)
/api/v1/comments/{post_id} - GET comments on a post, with these params:
- number of comments to fetch
- offset
- from & to timestamps


Oooh, also a param for fetching just unscreened comments.


[personal profile] casimirian 2017-10-15 06:38 am (UTC)(link)
Heh. I've noticed. :) Np.
gatheringrivers: (Default)

[personal profile] gatheringrivers 2017-10-15 07:38 am (UTC)(link)
It was! Those who knew about it sometimes set up "secret journals" with only trusted people having access/knowing the address.
gatheringrivers: (Default)

[personal profile] gatheringrivers 2017-10-15 07:40 am (UTC)(link)
Please make sure that's enforced on the side of DW servers rather than the client. :)

With everything in the news, I'm sure people will appreciate feeling more like private/filtered entries will actually STAY that way regardless of how people access the journal.

Page 2 of 3