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

Query to /api/subscribers?list_id=... is malformed #4

Open
EliRibble opened this issue Oct 21, 2024 · 0 comments
Open

Query to /api/subscribers?list_id=... is malformed #4

EliRibble opened this issue Oct 21, 2024 · 0 comments

Comments

@EliRibble
Copy link

From the docs the example query is:

curl -u 'username:password' 'http://localhost:9000/api/subscribers?list_id=1&list_id=2&page=1&per_page=100'

That is, list_id=1&list_id=2.

When using the go-listmonk client:

listService := client.NewGetSubscribersService()
listService.ListIds([]uint{4})
ctx := context.Background()
listService.Do(ctx)

This leads to a query like:

GET https://mailing-list.tealok.tech/api/subscribers?list_id%5B0%5D=%5B4%5D

Un-encoded that's:

https://mailing-list.tealok.tech/api/subscribers?list_id[0]=[4]

which is incorrect, and fails to filter by list_id.

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

1 participant