J-Novel Club
    • Categories
    • Recent
    • Tags
    • Users
    • Login

    Developer PSA: labs.j-novel.club is your new friend!

    Scheduled Pinned Locked Moved Suggestions & Feedback
    81 Posts 25 Posters 30.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • myskarosM
      myskaros Staff @yanrishatum
      last edited by

      @yanrishatum said in Developer PSA: labs.j-novel.club is your new friend!:

      Now onto the data that is present in old API, but is lacking in new one:

      I can't speak for chocolatkey, but as a sysadmin, most of that data you're saying is missing in the new API simply doesn't exist for a large majority of our series/volumes/parts. There were many miscellaneous data fields added over the years, but we never went back to ensure it was all filled out or check if it's all accurate. With development on the new backend underway, a lot of those data fields simply won't exist anymore, so that would explain why you can't obtain it in the new API.

      I think many of your grumbles have more to do with how data is stored in our current backend more than how the new API functions. Which is to say, once the new backend and database are up and running, I believe things will be much more logical with the new API as well.

      Whoever said nothing's impossible never tried slamming a revolving door.

      yanrishatumY 1 Reply Last reply Reply Quote 1
      • yanrishatumY
        yanrishatum Premium Member @myskaros
        last edited by

        @myskaros Totally fair, I don't care much about minor information, and main grumble is lack of parent IDs (I suppose those are stored in a separate relation tables as series<->volume / series<->part / part<->volume hence not listed, because that'd require extra queries?).
        Didn't work databases much lately so I'm rusty, but I'm pretty sure automated update of volume/part counters can be done with relative ease.
        Mainly I just don't like the idea of spamming server with multiple requests just to get full set of information to expand the relations, especially since it increases the latency at which said data can be shown (to be fair I can just show data as it comes in, and do a spinner for still loading parts, but still - far longer than one request that gets all the info) to user as well as just causes more strain on the server (one user is fine, but when there's lots of them - it adds up), and if mobile app would get more features such as more detailed novel information on a level of website - it can turn ugly.

        1 Reply Last reply Reply Quote 0
        • chocolatkeyC
          chocolatkey Staff
          last edited by

          The old part data API is now "dead"

          1 Reply Last reply Reply Quote 3
          • FalseAimF
            FalseAim Premium Member
            last edited by

            Can we get an endpoint for the calendar?

            Alternatively, if the event data listed the id or slug of the associated part or volume, I could get the information that way (but with more calls). Currently the event data just lists data for the series, not the part or volume.

            yanrishatumY 1 Reply Last reply Reply Quote 1
            • yanrishatumY
              yanrishatum Premium Member @FalseAim
              last edited by

              @falseaim https://labs.j-novel.club/app/v1/events is what you're looking for. Take a look at how calendar currently operates. You can pass it sort, start_date (ISO string), end_date and skip arguments. Use launch sort and define start/end date to get pretty much exactly what calendar is displaying. And skip is obviously for pagination.
              I.e. for example:
              https://labs.j-novel.club/app/v1/events?sort=launch&start_date=2022-04-30T21%3A00%3A00.000Z&end_date=2022-05-31T21%3A00%3A00.000Z.
              Each event provides valid IDs as well as series information and thumbnail.

              chocolatkeyC Crimson WiseC 2 Replies Last reply Reply Quote 0
              • chocolatkeyC
                chocolatkey Staff @yanrishatum
                last edited by chocolatkey

                @yanrishatum FYI date parameters can also be unix second timestamps. This applies anywhere in the new API

                1 Reply Last reply Reply Quote 2
                • Crimson WiseC
                  Crimson Wise Premium Member @yanrishatum
                  last edited by

                  @yanrishatum still, having the volume ID attached to the event would be helpful to me. As far as I can tell, it's just the event and series IDs, and the former is the ID of the event, not the part or volume.

                  That said, I can work around it by playing with the slugs.

                  Quof got a break.
                  WHAT'S THE STORY WITH THAT FREAKING BLACK DRAGON?!

                  chocolatkeyC 1 Reply Last reply Reply Quote 0
                  • chocolatkeyC
                    chocolatkey Staff @Crimson Wise
                    last edited by chocolatkey

                    @crimson-wise The reason there's no volume ID attached to that even is that we would actually have to figure out the volume of each event based on slug lookup, because it's not "attached" in the database, and that's inefficient to do right now, especially for large calendar queries

                    1 Reply Last reply Reply Quote 1
                    • chocolatkeyC
                      chocolatkey Staff
                      last edited by

                      Added the following to the list:

                      GET https://labs.j-novel.club/app/v1/volumes/{ID or slug}/skus // Volume's third-party purchase options
                      GET https://labs.j-novel.club/app/v1/volumes/{ID or slug}/price // Volume's pricing on JNC
                      POST https://labs.j-novel.club/app/v1/me/credits/convert // Convert credits to coins
                      POST https://labs.j-novel.club/app/v1/me/coins/purchase // Purchase coins
                      POST https://labs.j-novel.club/app/v1/me/coins/redeem/{ID or slug} // Redeem coins by volume slug or ID
                      GET https://labs.j-novel.club/app/v1/me/coins/options // Get coin pricing options
                      

                      Astute API users will notice that some more endpoints have been removed from the old API

                      1 Reply Last reply Reply Quote 0
                      • chocolatkeyC
                        chocolatkey Staff
                        last edited by

                        Added GET https://labs.j-novel.club/app/v1/me/history. Required a from and until query parameter with unix timestamps. Lowest acceptable value for either is 1448841600

                        1 Reply Last reply Reply Quote 0
                        • kualiK
                          kuali Premium Member
                          last edited by

                          Is there any way to track when a manga volume was last updated or downloaded? For regular ebooks, /me/library has the lastDownload and lastUpdated fields, but I can't spot anything equivalent for manga.

                          https://forums.j-novel.club/topic/6701/omnibus-builder
                          https://forums.j-novel.club/topic/5745/ascendance-of-a-bookworm-omnibus-editions

                          The Primal Desires: Food, Sleep, Sex, StroZero, Hypnotism, and Awayuki Kokorone.

                          Item Diaria Apothecaria legi debent.

                          1 Reply Last reply Reply Quote 0
                          • T
                            talisein Premium Member
                            last edited by

                            It'd be great if the me/library's book.download object had a crc32 or any kind of hash. Even just the content length if nothing else; I tried HEADing the download link but there's no size in the headers even.

                            chocolatkeyC 1 Reply Last reply Reply Quote 0
                            • chocolatkeyC
                              chocolatkey Staff @talisein
                              last edited by

                              @talisein that's because the ebooks are generated on the fly as they're downloaded. Some sort of etag-equivalent unrelated to the content of the final ebook you download maybe be a possibility in the future, but it will probably never be a checksum of the content itself

                              1 Reply Last reply Reply Quote 0
                              • chocolatkeyC
                                chocolatkey Staff @yanrishatum
                                last edited by chocolatkey

                                @yanrishatum

                                Have to also note about /parts/$id/toc not making sense, as it clearly should be /series/$id/toc / /series/$id/parts

                                I know, it's weird. It's a quirk of dealing with the current database and how everything is connected, and it's just easier/more efficient for now to say "I am currently reading this part and I want the TOC for its series" for the mobile app, for which this API was originally designed for. We'll have a better TOC API in the future, probably /v2

                                Regarding your suggestion for accepted content-type, I'll look into it, first I have to make sure it doesn't break any of the clients

                                1 Reply Last reply Reply Quote 0
                                • chocolatkeyC
                                  chocolatkey Staff
                                  last edited by

                                  Added the following to the list:

                                  PUT https://labs.j-novel.club/app/v1/me
                                  GET/POST https://labs.j-novel.club/app/v1/me/subscription
                                  POST https://labs.j-novel.club/app/v1/me/subscription/sync
                                  POST/DELETE https://labs.j-novel.club/app/v1/me/subscription/cancel
                                  POST https://labs.j-novel.club/app/v1/me/subscription/estimate
                                  GET/DELETE/PUT https://labs.j-novel.club/app/v1/me/method
                                  GET https://labs.j-novel.club/app/v1/me/method/setup
                                  

                                  Subscription management through the old API is no longer supported, and may be removed at any time.

                                  P.S. I'm getting tired of updating/maintaining this list, it will soon be time for proper API docs, currently researching the most appropriate/best docs generator.

                                  1 Reply Last reply Reply Quote 1
                                  • RanR
                                    Ran @chocolatkey
                                    last edited by

                                    Thanks for making all this available, even unofficially -- if you add proper API docs that'll be more than some major companies provide for official partners. :)

                                    Speaking of APIs ...
                                    @chocolatkey said in Developer PSA: labs.j-novel.club is your new friend!:

                                    POST https://labs.j-novel.club/app/v1/me/coins/purchase

                                    Knowing the kind of parameters each takes would be really helpful -- it's a lot harder to work backwards with protobufs!

                                    chocolatkeyC 1 Reply Last reply Reply Quote 0
                                    • chocolatkeyC
                                      chocolatkey Staff @Ran
                                      last edited by chocolatkey

                                      @Ran Yeah protobufs docs is also part of what I want to expose... For now have this, you POST it a PurchaseRequest

                                      message StripePaymentIntent {
                                          string payment_method = 1;
                                          string payment_intent = 2;
                                      }
                                      
                                      message PurchaseRequest {
                                          enum Processor {
                                              DEBUG = 0; // Only works when debug mode is enabled on the server
                                              STRIPE = 1; // Stripe
                                              // Insert app payment processors here!
                                          }
                                          Processor processor = 1; // The payment processor to use
                                          uint32 amount = 2; // The amount of coins to purchase
                                          oneof intent { // The payment intent from the processor
                                              StripePaymentIntent stripe_payment_intent = 3;
                                          }
                                      }
                                      

                                      If I remember correctly the enum values need to use the names in JSON, so "processor":"STRIPE"

                                      RanR 1 Reply Last reply Reply Quote 1
                                      • RanR
                                        Ran @chocolatkey
                                        last edited by

                                        @chocolatkey Awesome, thanks! That's exactly what I needed. You were totally right about the enum name -- and I would never have figured out how to pass along the payment intent without seeing the protos laid out like that.

                                        1 Reply Last reply Reply Quote 0
                                        • chocolatkeyC
                                          chocolatkey Staff
                                          last edited by chocolatkey

                                          Added a new GET https://labs.j-novel.club/app/v1/series/{ID or slug}/aggregate , to get all data regarding a series (series, volumes, parts). Should be identical to making the individual requests

                                          1 Reply Last reply Reply Quote 3
                                          • chocolatkeyC
                                            chocolatkey Staff
                                            last edited by

                                            Added "status" to series, which can be (in JSON format) one of "DEFAULT", "COMPLETE", "HIATUS"

                                            1 Reply Last reply Reply Quote 2
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 2 / 5
                                            • First post
                                              Last post