Skip to content

getUserByKey default response is not working properly #66

@brunofno

Description

@brunofno

Hi,

In the following documentation: https://getstarted.sailthru.com/new-for-developers-overview/email-and-user-profiles/user/#User_Profile_Fields_Reference

We can read this in the documentation for the parameter "fields" : The default response consists of keys, vars, lists, engagement, and optout_email.

In the code, if the parameter "fields" is not set, its default value is an empty array.
public function getUserByKey($id, $key, array $fields = [ ])

The problem is, if you call that function using the default values, the payload will contain an empty fields array. The response is literally this:
[]

For the default response to work, the payload must not contain the fields parameters, but the way the function is done, it always include an empty fields array if it's not set. We can't access the default response because of that.

Unless that is wanted and the documentation is out of date. I'm not sure on that part, that's why I'm opening an issue so you can decide. :)

Thank you and have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions