Objects
This document will cover all the nodejs methods related to objects
Objects in SuprSend represent non-user entities such as organizations, teams , roles, and projects. Understand more about objects from our objects documentation
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.
Here’s a list of all edit helper methods:
After calling add_*/remove_*/unset
methods, don’t forget to call object_ins.save()
. On call of save(), SDK sends the request to SuprSend platform to update the Object Profile.
List Objects
List objects for an object_type
. You can also pass listing options in the payload which includes limit
,before
,after
Get Object Details
Create Subscriptions
List Subscriptions
Remove Object Subscription
Get List of Objects Subscribed by Object
An object can subscribe to other objects. Use this method to get the list of all objects that the current object has subscribed to.