Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing API Documentation #114

Open
TheGameProfi opened this issue Aug 21, 2024 · 11 comments
Open

Missing API Documentation #114

TheGameProfi opened this issue Aug 21, 2024 · 11 comments

Comments

@TheGameProfi
Copy link

Hey there,

I noticed that the Duplicati docs don’t really cover the API, which can make things tricky for anyone trying to work with it programmatically. I’ve been digging into the Pectojin/duplicati-client repo and collected some info on the API that I think could be useful if added to the main docs.

What I’m Proposing:

  • New API section in the docs with an overview of the endpoints and what they do.
  • Examples based on what’s in the duplicati-client repo.

What I Need:

  • Are there any specific guidelines or formatting rules I should follow to keep things consistent with the rest of the docs? If not, I’m happy to draft something and get feedback.
  • Is this something the maintainers would want in the docs?

I think this could really help devs who are looking to integrate Duplicati into their setups. Let me know what you think!

Cheers!

@kenkendk
Copy link
Collaborator

kenkendk commented Aug 22, 2024

Hi @TheGameProfi, I have recently updated the API slightly to be a bit more modern.
To aid in developing a client, you can now get a Swagger API overview:
duplicati/duplicati#5470

I think this overview can at least serve as a starting point for the documentation.

@kees-z
Copy link
Owner

kees-z commented Aug 22, 2024

Hi @TheGameProfi, your contribution is much appreciated!
There are no strict guidelines, but I'd guess the best option is to create a new file something like 09-application-programming-interface.md and update the content similar to the layout in other chapters.
You can use Info/Warning blocks and blocks that contain OS-specific info, see this section (Raw version) for more info.

@TheGameProfi
Copy link
Author

There are no strict guidelines, but I'd guess the best option is to create a new file something like 09-application-programming-interface.md and update the content similar to the layout in other chapters.

My idea is to create a new set of files like api-example.md and api-auth.md, and then add another drop-down menu for the API, similar to the Manual and Articles sections.

To aid in developing a client, you can now get a Swagger API overview:
duplicati/duplicati#5470

Thanks for the information! That seems like a good starting point. I haven't quite figured out how to enter Debug Mode to access the Swagger UI. Could you guide me on how to get there?

@kees-z
Copy link
Owner

kees-z commented Aug 22, 2024

I would prefer making the API-documentation part of the manual, creating a new chapter for describing the API. In that chapter, you can create as many subsections as you like. The main chapters will be displayed at the left side of the documentation, at the right side all subsections (API examples, API auithentication etc.) will be displayed for quick navigation. That's about how the current layout is set up.
Is there any reason for keeping the API-documentation outside the manual?

@TheGameProfi
Copy link
Author

Not directly, but it’s more of a personal preference to have the API documentation separate from the manual and visible at first glance when accessing the documentation.

@kees-z
Copy link
Owner

kees-z commented Sep 4, 2024

I can't think of any reason why the API documentation should be treated differently than other parts of the manual. I agree that it deserves its own chapter, but I prefer to keep the main page clean and try to avoid more sections than the current Manual and Articles sections. I guess the API documentation fits better in Manual than in the Articles section.

@TheGameProfi
Copy link
Author

It was some time since there was some Activity. I now started writing the "Documentation".
One Trouble i wanted to talk with you about, there are Some API Routes I retrieved from the Source-Code but when I tried to call it, it doesn't Work. Should I mention these or just leave them out?

@kees-z
Copy link
Owner

kees-z commented Nov 14, 2024

Sorry for the late reply, somehow I missed this one...
I wouldn't include information that is known not to work as it creates confusion. Instead take a note of the API calls that have problems and report an issue to the Duplicati development team.

@kenkendk
Copy link
Collaborator

@TheGameProfi Do you have some of those routes? I would like to investigate.
There should be no routes/endpoints that are not working.

@TheGameProfi
Copy link
Author

@TheGameProfi Do you have some of those routes? I would like to investigate. There should be no routes/endpoints that are not working.

I used the Endpoints/V1 folder and extracted the Api Routes from there, since i couldn't get to the Swagger API.
And I got a 404 No such module from

  • /api/v1/auth/issuetoken/export
  • /api/v1/auth/issuetoken/bugreport

And an 400 Invalid component from

  • /api/v1/backup/{id}/export-argsonly
  • /api/v1/backup/{id}/export-cmdline

@kenkendk
Copy link
Collaborator

@TheGameProfi The two auth related endpoints are "post" only methods.
I guess the API should return 405 if you call them with GET.

Not sure why you get a 400 on the two other paths. They are working when invoked from the current FE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants