Create, update, & manage objects and their subscriptions with Java SDK.
Objects in SuprSend represent non-user entities such as organizations, teams , roles, and projects. Understand more about objects from our objects documentation
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.
There are 2 ways in which you can edit an object data.
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.
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
Use object_ins.add*
method(s) to add user channels in a profile
Remove Channels
Use object_ins.remove*
method(s) to remove channels from an object profile
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
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
You can set timezone of user using this method. Value for timezone must be from amongst the IANA timezones.
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
Remove any custom property key using this method.
Append
This method will append a value to the list for a given property.
Remove
This method will remove a value from the list for a given property.
Set Once
Works just like object_ins.set
, except it will not overwrite existing property values. This is useful for properties like First login date
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 for an object_type
. You can also pass listing options in the payload which includes limit
,before
,after
An object can subscribe to other objects. Use this method to get the list of all objects that the current object has subscribed to.