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

Emma's API expects "true", but is given "1" #8

Open
justinmaurerdotdev opened this issue Nov 22, 2016 · 1 comment
Open

Emma's API expects "true", but is given "1" #8

justinmaurerdotdev opened this issue Nov 22, 2016 · 1 comment

Comments

@justinmaurerdotdev
Copy link

justinmaurerdotdev commented Nov 22, 2016

I found this while trying to get a member count. If I use $emma->myMembers(array('count' => true)), the boolean value is converted to a 1 by http_build_query. Unfortunately, the Emma API seems to be expecting ?count=true or ?count=false (not ?count=1), so it ignores this parameter, and the response is an array of the first 500 members instead of an integer count.

Using $emma->myMembers(array('count' => 'true')) solves the issue. So, you should probably update the documentation OR we should see if Emma can change their API to check for any boolean value. Let me know if you have any questions.

@skorasaurus
Copy link

+1. Ran into this and was getting same result. Thanks for reporting a workaround @AbacusPowers

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

2 participants