-
Notifications
You must be signed in to change notification settings - Fork 46
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
getUserByKey default response is not working properly #66
Comments
Hi @brunofno, To clarify:
Is that correct? While we don't encourage pulling for more information than you need, the consistency makes sense, and I think updates the request to reflect this makes sense. I can try to address this in the next update, or you can feel free to make a pull request. |
Hi @silverman63 I'm not really used to github. I've tried to make a pull request, seems I have some authentification issues, not really sure. Anyway, the fix is easy, it looks like this:
This prevent returning the empty array response. Thank you! |
Hi @brunofno, I think that's a reasonable change. Will add this in the next release. |
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!
The text was updated successfully, but these errors were encountered: