Skip to content

Where is the API documentation for CodiMD? #7

Closed

Description

@jakubgs

I'd love to add some more options to this tool but I can't seem to find any docs on the API.

Could you maybe add that info in the README.md? So it's easier for a potential contributor to see what's doable.

Activity

  1. ccoenen commented on Oct 17, 2018

    @ccoenen
    Collaborator

    Hi @jakubgs! There's not really much documentation, mostly because we don't really have a defined API in that sense(, yet!). If you wish, we could discuss things over in our matrix channel. Or you could describe what you'd like to achieve in a ticket here or in CodiMD itself and we could give you pointers on where to look.

  2. pirate commented on Oct 18, 2018

    @pirate
    Member

    Here are some of the undocumented endpoints that may interest you @jakubgs:

    • https://<codimd_server>/history (requires auth)
    • https://<codimd_server>/new
    • https://<codimd_server>/<note_id>/publish
    • https://<codimd_server>/<note_id>/download
    • https://<codimd_server>/<note_id>/pdf
    • https://<codimd_server>/<note_id>/slide

    I've added them to the README here: https://github.com/hackmdio/codimd-cli/blob/master/README.md#api-endpoints

  3. jakubgs commented on Oct 18, 2018

    @jakubgs
    Author

    Hey, I'm getting on a flight so I won't be responding for a while but what I wanted are two things:

    • Able to specify the URL under which I want to import the document
    • Able to import a Mardown file multiple times to the same URL

    I'll look at the code later, maybe during the weekend.

  4. pirate commented on Oct 18, 2018

    @pirate
    Member

    @ccoenen if you know of an endpoint like https://<codimd_server>/<note_id>/edit that lets us push raw markdown that would probably do the trick, although it will likely require auth unless the permissions are set to Freely.

  5. ccoenen commented on Oct 18, 2018

    @ccoenen
    Collaborator

    Right now, there is no /edit endpoint. Editing is a little tricky, because you'd also need to inform possibly connected users at the same time. And push them a diff of the document (or at least have them reload the document).

    @jakubgs what you might be able to do, if your instance is configured for it, is POST a document to an alias url. So if /list-of-star-wars-collectibles does not yet exist, a new note might be created, and its alias could be list-of-star-wars-collectibles with the content in your POST body. More info can be found here: hackmdio/codimd#673 there it is deschribed for the /new endpoint, but it might be working for any url. If it is not working for any URL, yet, it might be very simple to enable that.

  6. andristeiner commented on Oct 23, 2018

    @andristeiner

    To migrate over content of a fairly big Etherpad Lite installation, im interested in adding documents to a given note_id as well. Unfortunately, it does not work by just POST'ing to /desired-name as proposed @ccoenen

  7. pirate commented on Nov 23, 2018

    @pirate
    Member

    Closing this as the API documentation discussion should happen over in the main repo. I've also added a list of the endpoints used by the CLI to the readme. Once an /edit endpoint is added to codimd-server we can open an issue back here to add support for it in the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions