Skip to content

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

@justinmaurerdotdev

Description

@justinmaurerdotdev

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.

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