API Reference

Users.updateUserInfo

Updates a user's information personal information and metadata.

The meta data field is a bit special. The meta field must be supplied as an array. The new user meta-data will be a merge of the existing meta-date + the newly supplied metadata. Only the top-level elements in the array will be merged, if you have an array within an array, the old top-level array will be completely overwritten. If you just want to get rid of some metadata, we advice to simply supply an empty value.

If no user id is supplied this method will update the information of the currently logged in user.


Syntax

mixed users.updateUserInfo ( mixed id = 0, array newProperties = array(), mixed returnUserInfo = false )

Arguments

NameTypeRequiredDefault valueDescription
idmixedOptional0
newPropertiesarrayOptionalarray()
returnUserInfomixedOptionalfalse

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/users/updateUserInfo?id=[USER_ID]&newProperties[firstname]=[USER_NEW_FIRSTNAME]&newProperties[meta][key]=[THE_NEW_VALUE]&APIKEY=[APIKEY]
<?xml version="1.0" encoding="UTF-8"?>
<result>1</result>
Sample JSON Response
{
    "status": true,
    "result": 1
}

Code examples

0 comments

Be the first to comment on updateUserInfo.

Add a Comment

  • captcha