Update a User
Update information of a particular user.
Parameter
Accessible via URL https://api.channel.io/open/v4/users/{userId}
and HTTP PATCH
Present parameters in PATCH body. This method does currently accept
application/json
only.
Parameter | Example | Required | Description | Parameter type |
---|---|---|---|---|
userId | 5ec3a01fe2b3f4d2cbc5 | Required | ID of User | Path |
profile | {"name": "Gabrielle Chanel", ..} | Optional | Profile object contains user information | Body |
profileOnce | {"utmSource": "google", ..} | Optional | Profile object contains user information. But, do not update if property is present | Body |
tags | ['tag1', 'tag2'] | Optional | User's tag attribute . Replace all of them with the newly given array. | Body |
unsubscribed | true or false | Optional | When this property is set to true, no marketing message will be sent. | Body |
unsubscribeTexting | true or false | Optional | When this property is set to true, no marketing SMS will be sent. |
Example
PATCH https://api.channel.io/open/v4/users/5ec3a01fe2b3f4d2cbc5
Your PATCH body should look like below
{
"profile":{
"name":"string",
"empty":true,
"email":"string",
"avatarUrl":"string",
"mobileNumber":"string",
"additionalProp1":{},
"additionalProp2":{},
"additionalProp3":{}
},
"profileOnce":{
"name":"string",
"empty":true,
"email":"string",
"avatarUrl":"string",
"mobileNumber":"string",
"additionalProp1":{},
"additionalProp2":{},
"additionalProp3":{}
},
"tags":[
"string"
],
"unsubscribeEmail":true,
"unsubscribeTexting":true,
"language":"string",
"web":{
"device":"string",
"os":"string",
"osName":"string",
"browser":"string",
"browserName":"string",
"sessionsCount":0,
"lastSeenAt":1624422372181
},
"mobile":{
"device":"string",
"os":"string",
"osName":"string",
"appName":"string",
"appVersion":"string",
"sessionsCount":0,
"lastSeenAt":1624422372181
},
"managedKey":0,
"member":true,
"email":"string",
"avatarUrl":"string",
"mobileNumber":"string",
"systemLanguage":"string"
}
Response
Returns the changed User
object.
{
"user": {
"id": "string",
"channelId": "string",
"memberId": "string",
"veilId": "string",
"unifiedId": "string",
"name": "string",
"profile": {
"name": "string",
"empty": true,
"email": "string",
"avatarUrl": "string",
"mobileNumber": "string",
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"profileOnce": {
"name": "string",
"empty": true,
"email": "string",
"avatarUrl": "string",
"mobileNumber": "string",
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"tags": [
"string"
],
"alert": 0,
"unread": 0,
"popUpChatId": "string",
"blocked": true,
"unsubscribeEmail": true,
"unsubscribeTexting": true,
"hasChat": true,
"hasPushToken": true,
"language": "string",
"country": "string",
"city": "string",
"latitude": 0,
"longitude": 0,
"web": {
"device": "string",
"os": "string",
"osName": "string",
"browser": "string",
"browserName": "string",
"sessionsCount": 0,
"lastSeenAt": 1624422372181
},
"mobile": {
"device": "string",
"os": "string",
"osName": "string",
"appName": "string",
"appVersion": "string",
"sessionsCount": 0,
"lastSeenAt": 1624422372181
},
"sessionsCount": 0,
"lastSeenAt": 1624422361664,
"createdAt": 1624422361767,
"updatedAt": 1624422361664,
"version": 0,
"managedKey": 0,
"member": true,
"email": "string",
"avatarUrl": "string",
"mobileNumber": "string",
"systemLanguage": "string"
},
"online": {
"channelId": "string",
"personType": "string",
"personId": "string",
"id": "string"
}
}
Return HTTP status code 200
if succeed
Updated about 1 year ago