Synchronize users data with Subiz API

Last updated 3 months ago

API (application programming interface) is a set of clearly defined methods of communication between various software components. Subiz provides a Javascript API that synchronizes users data between the Subiz app and the website. You can update users information, retrieve users and clear users.

Important notes:

  • API snippets should be placed after the Subiz embed code in the website code page. No need to follow closely, just make sure the Subiz embed code is placed over the API snippets.

  • To use Javascript API, only programmers can install according to instructions. If your business does not have its own programmer, hire a frelance programmer to help them.

1. User attributes

The four default user attributes set up on Subiz are about basic user information, such as: Full name, Email address, Phone number, Address.

Subiz lets you create and generate new attributes about your users, based on criteria that is specific to your business. You can user this data as qualification data to qualify leads and boost sales. You can also use this data to filter and send targeted Automation messages.

To add a new attribute, you log in App.subiz.com > SETTING > ACCOUNT > User Attributes > Select New Attribute

Create new attribute on Subiz

2. API updates user attributes on Subiz

You can use the Javascript Subiz API to update automatically your default user attributes on Subiz or update your own custom user attributes.

Here is an example of Javascript API to update full-name attribute:

<script>
subiz('updateUserAttributes', [{ key: 'fullname', text : 'David’ }]);
</script>

Things must remember:

  • Key is attribute key

  • Data type: Text, Number, Boolean, List, Date Time. (See detailed notes)

Here are just some examples of what our JavaScript API lets you do:

2.1. Update a default attribute

Full name attribute
Phone number attribute
Email address attribute

<script> subiz('updateUserAttributes', [{ key: 'fullname', text : 'David’ }]); </script>

<script> subiz('updateUserAttributes', [{ key: ’phones’, text : '09123456789', '0987654321' }]); </script>

<script> subiz('updateUserAttributes', [{ key: 'emails’, text :'example1@domain.com, example2@domain.com' }]); </script>

2.2. Update simultaneously multiple default attributes

Update simultaneously multiple default attributes
<script>
subiz('updateUserAttributes', [{ key:'fullname', text : 'David' },{ key:'phones', text : '09123456789' } ]);
</script>

2.3. Update new custom attribute(s)

Below are two examples of such custom attributes as Language and Customer:

Language attribue
Customer attribute

<script> subiz('updateUserAttributes', [{ key:'ngon_ngu', list : [‘Vietnamese’, ‘English’] } ]); </script>

<script> subiz('updateUserAttributes', [{ key:'khach_hang', boolean : true }]); </script>

3. API deletes all user data

API allows you to delete user data on Subiz. Deleted user data will be clear on client and on Subiz so that that Subiz agent cann't see these clients.

API deletes all user data

<script> subiz('forgetMe'); </script>

4. API synchronizes user data from Subiz to website

API allows you to synchronizes user data from Subiz to website.

API synchronizes user data from Subiz to website

<script> subiz('getUserAttributes', (attributes) => {console.log('user attributes', attributes)}); </script>

Do you need help? Just click on Subiz.com and chat with us!