Upsert (create/update) an object
Object updating is an upsert function, meaning it would always override existing key values on further updates. Object id and type is mandatory to create object. You can optionally pass object properties (to use in template or workflow condition) or channel information (send notification on object channels) in the payload.Edit an object
There are 2 ways in which you can edit an object data.- Build edit payload yourself
- Use helper methods provided by SDK (Recommended)
1. Build edit payload yourself
Use this to modify an object, typically for removing channels or unsetting properties. The payload will follow the same structure as the Object Edit API.2. Edit using helper methods [Recommended]
It is possible to use the SDK’s helper methods to perform edit operations on an object. For this, first create object instance then call any of the helper methods mentioned below and finally save the changes.Add Channels
Add Channels
Use
object_ins.add*
method(s) to add user channels in a profileRemove Channels
Remove Channels
Use
object_ins.remove*
method(s) to remove channels from an object profileRemove Channels in bulk
Remove Channels in bulk
This method will delete/unset all values in specified channel for object (ex: remove all emails attached to object).
Set Preferred language
Set Preferred language
If you want to send notification in user’s preferred language, you can set it by passing language code in this method. This is useful especially for the applications which offer vernacular or multi-lingual support.
Set Preferred Timezone
Set Preferred Timezone
You can set timezone of user using this method. Value for timezone must be from amongst the IANA timezones.
Set
Set
Set any custom property using this method. It will shallow merge existing properties with new values. Key shouldn’t start with
$
or ss
.Unset
Unset
Remove any custom property key using this method.
Append
Append
This method will append a value to the list for a given property.
Remove
Remove
This method will remove a value from the list for a given property.
Set Once
Set Once
Works just like
object_ins.set
, except it will not overwrite existing property values. This is useful for properties like First login dateIncrement
Increment
Add the given amount to an existing property on the object. If the object does not already have the associated property, the amount will be added to zero. To reduce a property, provide a negative number for the value.
List objects
List objects for anobject_type
. You can also pass listing options in the payload which includes limit
,before
,after