momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)
Cocoa ([personal profile] momijizukamori) wrote in [site community profile] dw_dev2020-04-26 11:25 pm
Entry tags:

API updates - looking for testers

Hello friends! It's been a while since the last API update, but I finally got some bugs fixed, and am now at the point of needing testers to help me find the rest of them so we can get this thing going! If you are interested in helping, you don't need any real coding experience, but you do have to be okay at reading docs.

Instructions:
1) Go to http://www.momiji.hack.dreamwidth.net/create and create an account

2) Go to http://www.momiji.hack.dreamwidth.net/api/

3) Paste the bolded token into the box in the authenication section

4) Click on paths to expand them and use the fields to try the requests out.

5) Report errors or unexpected behavior here!

Note 1: Tropospherical layout CSS is not loading properly for reasons unrelated to the API code that I haven't sorted out yet. Other themes work, and site functionality is fine, just kind of ugly

Note 2: The API demo stuff doesn't match the rest of the styling, and will probably only work on relatively recent browsers (the last year or so). This isn't the final form, I'm just using a third-party package so I can get all the backend stuff working before spending time on making the page pretty and matching to out site styles

Note 3: I'm going to try to get the content-importer going for people who want to import some test data, but the workers are fussy to run in development

Stuff what needs fixing
- /journals/{username}/entries claims to return information about the new entry when you post to it, but currently just returns success or failure
- Editing an entry successfully returns no useful information
- Requesting a non-existent entryid on a journal returns confusing error
- Posting entries currently missing music and location attributes
- Posting entries currently missing mood and preformatted attributes

[personal profile] casimirian 2020-04-27 04:25 am (UTC)(link)
Yay! I will assist.

[personal profile] jazzyjj 2020-04-27 11:54 am (UTC)(link)
I'll take a look and see what I can do since I've actually had some quality time to myself during the lock-down, lol. But I don't have much programming experience, and my Mac battery hasn't been too happy with me recently.
kaisa: (Default)

[personal profile] kaisa 2020-04-27 07:34 pm (UTC)(link)
I used Postman and Newman for automated API testing (at work) a couple of years ago, is that something that would be useful or have you/someone else done something like that already?
Edited 2020-04-27 19:36 (UTC)
lunchbreaks: (you can take the future even if you fail)

[personal profile] lunchbreaks 2020-04-28 11:56 pm (UTC)(link)
Kind of a silly question, but is there a way to actually read my entries? I just wanted to see if passing html to the entries post endpoint would resolve correctly or read literally.

Also - great work!!
lunchbreaks: (radio someone still loves you)

[personal profile] lunchbreaks 2020-04-29 12:27 am (UTC)(link)
Ah ok, missed the url it gives back entirely. Nice!

For anyone else browsing and wondering: yes, it resolves the html
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2020-04-29 04:40 pm (UTC)(link)
It's really good to see this coming along. I especially like the curl commands, for those of us who like to write client-side utilities in Bash. A few anomalies in posting/editing an entry; all as far as I can tell differences from the behavior of the flat and XML APIs, so they're probably just things you haven't gotten around to.

POST /journals/{username}/entries/
* several input parameters appear to be missing; the ones I noticed were "preformatted" and "location", but I'm pretty sure there are others.
* passing non-existent parameters doesn't have any effect, but doesn't produce an error or warning either. That may be a feature.

I originally had returning the entryID when posting, but I see you already have that under "stuff what needs fixing". Consider returning the date as well as the url and/or entryID; otherwise lag between client and server could result in the client having a wrong idea of the date. That's less important, since a client that cares about it can supply its own date.

/journals/{username}/entries/{entry_id}
* POST returns an HTML error page even if the entry exists.
* GET returns 'successfully' when given a nonexistent entryID

mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2020-05-01 06:12 pm (UTC)(link)
I was just using the example forms on the JS page; re-checked and edit worked okay -- not sure what I was doing wrong.

I see what was happening with GET -- I was making changes in the low-order digit of the entryID, but it seems to be ignoring the anum portion. When I gave it something that differed in the high-order byte it returned with success=0, although as you say the response code was still 200. On second thought it's not clear what it _should_ be; the _operation_ failed, but one could argue that the API call succeeded.

Edit: The appropriate status code should probably be 404 -- see https://restfulapi.net/http-status-codes/
Edited (looked up best practice for restful APIs) 2020-05-01 20:43 (UTC)
nataraj: (Default)

[personal profile] nataraj 2022-02-06 09:23 am (UTC)(link)

Hi!

I am interested in more-api. Does any help is still needed?

I've tried to create an account in http://www.momiji.hack.dreamwidth.net/create, but got an "Oops!" page in response.

And http://www.momiji.hack.dreamwidth.net/api/v1/spec does not show spec from api-more branch.

nataraj: (Default)

[personal profile] nataraj 2022-02-07 03:06 pm (UTC)(link)

Yeah. I've managed to create nataraj2 user. (nataraj user is broken as far as I can guess, but this will do).