knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
14.46k stars 1.32k forks source link

Incorrect Example Request in Listmonk API Documentation #1939

Closed Prachi-Jamdade closed 1 month ago

Prachi-Jamdade commented 1 month ago

I noticed an error in the example request provided for the Listmonk API documentation at various places.

The documentation currently shows the following example for Basic Auth examples of Lists , Import , Media , Templates .

Issue:

The documentation currently shows the following example for a endpoint request:

curl -u "username:username" -X GET 'http://localhost:9000/api/templates'

This example uses the same value for both the username and password, which is incorrect.

Correction:

The correct example should differentiate the username and password, as shown below:

curl -u "username:password" -X GET 'http://localhost:9000/api/templates'

Screenshots:

Screenshot showing the incorrect example (401 Unauthorized error):

WhatsApp Image 2024-07-15 at 10 01 46 PM

Screenshot showing the correct example (200 OK response):

WhatsApp Image 2024-07-15 at 10 03 19 PM

Steps to Reproduce:

  1. Follow the current example provided in the documentation
  2. Observe that it returns a 401 Unauthorized error.
  3. Use the corrected example
  4. Observe that it returns a 200 OK response.

Expected Behavior:

The documentation should provide a correct example that successfully authenticates and returns a 200 OK response.

Prachi-Jamdade commented 1 month ago

Hello, @knadh

I can work on this and will raise a PR to fix this in the documentation. Let me know what you think, will do it if it's a go-ahead from you

knadh commented 1 month ago

Please send a PR. Thank you.