k_auerbach
8 years agoHelper
HTTP PUT for email_excluded
Hi,
I've been trying to change the "Do not Email" setting of an userprofile by setting email_excluded to true/false.
I already asked Lithium Support for help, they told me to do an HTTP PUT to /api/2.0/users/ with a JSON payload that includes the "email_excluded" like:
{
"data": {
"type": "user",
"email_excluded": false
}
}
I've tried an http.client.request like:
<#assign http_client_request = http.client.request.body("https", "myurl", "/api/2.0/users/366").body("{'data':{'type': 'user','email_excluded':false}}", "application/json").put() />
But I got this error:
An error has occurred when reading existing sub-variable "client"; see cause exception! The type of the containing value was: extended_hash+string (lithium.coreapi.webui.template.models.HttpTemplateModel wrapped into f.e.b.StringModel)
I would appreciate any help, Thanks!