Solver AI Suite is an API first platform that enables you to integrate and use it through Rest API.
If you tend to use Automation Studio through API, you can find below examples and way through for smooth integration and usage of advanced functionalities.
Before attempting to create an automation, you should consider next features and based on that, build your payload:
1. What goal and action you plan to use automation for:
Goals:
- Boost revenue
- Lead generation
- Improve customer experience
- Lead nurturing
- Custom goal
Actions based on goal selected:
- Happy birthday greeting
- Warm up cold customers
- Build strong loyalty
- Send welcome message
- Cart abandonment reminder
- After purchase promotion
- First purchase promotion
- Custom action
2. What channel you plan to use for communication:
- Viber
- SMS
3. What are entries to your desired automation:
- API
- Query based
- Forms from Form Studio
4. You choose when to exit the flow based on channel metrics
- e.g., Send Viber and wait 2 hours for the Viber message to be seen, if not send SMS
- You choose interval to wait for and status of the previous message
5. What placeholders and images you can use:
- You can use customer's first name, last name, vocative name. Also, you can use the top 5 recommended products and their names
- For Viber messages, you can use custom-made images for each product in the special offer (additional data integration required)
- For email, you can use raw product images, in case `item_image_url` is included in data integration.
6. You choose start and end date of the flow as well as Contact policy if you’d like to use it:
- How many times users can be contacted using this flow in how many days (e.g., 2 times in 10 days)
Request create automation
{
"client_name":"dev",
"author":"Dusan Savic",
"action":"first-purchase-promotion",
"flow_name":"First Purchase Query Duco",
"goal":"boost-revenue",
"start_date":"2024-06-05T14:00:00",
"end_date":"2024-06-18T14:00:00",
"is_approved":false,
"is_active":false,
"flow_rules":{
"entry_block":{
"block_name":"block_name_entry",
"block_type":"data-entry",
"data_entry_type":"query",
"attributes":[
{
"name":"query_id",
"operator":"is_present",
"value":"query-id-first-purchase",
"type":"string"
},
{
"name":"days_before",
"operator":"equals_to",
"value":"0",
"type":"integer"
},
{
"name":"email",
"operator":"is_present",
"value":"",
"type":"email"
},
{
"name":"phone_number",
"operator":"is_present",
"value":"",
"type":"phone_number"
},
{
"name":"first_name",
"operator":"not_equals_to",
"value":"",
"type":"string"
}
],
"block_disabled":false
},
"flow_control":[
{
"block_name":"block_name_0",
"block_type":"wait-until",
"block_datetime":"2023-10-26T14:38:00",
"next_block_name":"block_name_1",
"block_disabled":false
},
{
"block_name":"block_name_1",
"block_type":"message",
"block_description":"First Purchase Promotion",
"channel_type":"email",
"contact":{
"email":"$attributes.email",
"phone_number":"$attributes.phone_number"
},
"content":{
"subject":"Special offer just for you!",
"template_id":"dev_20240409095023"
},
"end":false,
"next_block_name":"block_name_2",
"block_disabled":false
},
{
"block_name":"block_name_2",
"block_type":"wait",
"period":"120",
"unit":"seconds",
"next_block_name":"block_name_3",
"block_disabled":false
},
{
"block_name":"block_name_3",
"block_type":"choice",
"choice_rules":[
{
"attribute":"status",
"type":"string",
"operator":"=",
"value":"opened",
"next_block_name":"block_name_4"
}
],
"default_block_name":"block_name_4",
"choice_statuses":[
"Delivered",
"Opened",
"Clicked",
"Bounced",
"Unsubscribed"
],
"block_disabled":false
},
{
"block_name":"block_name_4",
"block_type":"message",
"block_description":"First Purchase Promotion",
"channel_type":"viber",
"contact":{
"email":"$attributes.email",
"phone_number":"$attributes.phone_number"
},
"content":{
"channel_text":"Special offer just for you {{first_name}}!",
"button_text":"Offer",
"button_url":"https://thingsolver.com",
"image_url":"https://login.thingsolver.com/assets/ts-logo.png",
"validity_period":"48",
"validity_unit":"HOURS"
},
"end":false,
"next_block_name":"block_name_5",
"block_disabled":false
},
{
"block_name":"block_name_5",
"block_type":"wait",
"period":"120",
"unit":"seconds",
"next_block_name":"block_name_6",
"block_disabled":false
},
{
"block_name":"block_name_6",
"block_type":"choice",
"choice_rules":[
{
"attribute":"status",
"type":"string",
"operator":"=",
"value":"opened",
"next_block_name":"block_name_7"
}
],
"default_block_name":"block_name_7",
"choice_statuses":[
"Delivered",
"Opened",
"Clicked"
],
"block_disabled":false
},
{
"block_name":"block_name_7",
"block_type":"message",
"block_description":"First Purchase Promotion",
"channel_type":"sms",
"contact":{
"email":"$attributes.email",
"phone_number":"$attributes.phone_number"
},
"content":{
"sms_text":"Special offer just for you {{first_name}}!"
},
"end":true,
"next_block_name":"",
"block_disabled":false
}
]
},
"max_allowed_contacts":0,
"max_allowed_contact_frequency":0
}
Response create broadcast
{
"client_name": "dev",
"author": "Dusan Savic",
"flow_name": "First Purchase Query Duco",
"goal": "boost-revenue",
"action": "first-purchase-promotion",
"start_date": "2024-06-05T14:00:00",
"end_date": "2024-06-18T14:00:00",
"max_allowed_contacts": 0,
"max_allowed_contact_frequency": 0,
"flow_rules": {
"entry_block": {
"block_name": "block_name_entry",
"block_type": "data-entry",
"data_entry_type": "query",
"attributes": [
{
"name": "query_id",
"operator": "is_present",
"value": "query-id-first-purchase",
"type": "string"
},
{
"name": "days_before",
"operator": "equals_to",
"value": "0",
"type": "integer"
},
{
"name": "email",
"operator": "is_present",
"value": "",
"type": "email"
},
{
"name": "phone_number",
"operator": "is_present",
"value": "",
"type": "phone_number"
},
{
"name": "first_name",
"operator": "not_equals_to",
"value": "",
"type": "string"
}
]
},
"flow_control": [
{
"block_name": "block_name_0",
"block_type": "wait-until",
"block_datetime": "2023-10-26T14:38:00",
"next_block_name": "block_name_1"
},
{
"block_name": "block_name_1",
"block_type": "message",
"block_description": "First Purchase Promotion",
"channel_type": "email",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"subject": "Special offer just for you!",
"template_id": "dev_20240409095023"
},
"end": false,
"next_block_name": "block_name_2"
},
{
"block_name": "block_name_2",
"block_type": "wait",
"period": "120",
"unit": "seconds",
"next_block_name": "block_name_3"
},
{
"block_name": "block_name_3",
"block_type": "choice",
"choice_rules": [
{
"attribute": "status",
"type": "string",
"operator": "=",
"value": "opened",
"next_block_name": "block_name_4"
}
],
"default_block_name": "block_name_4"
},
{
"block_name": "block_name_4",
"block_type": "message",
"block_description": "First Purchase Promotion",
"channel_type": "viber",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"channel_text": "Special offer just for you {{first_name}}!",
"button_text": "Offer",
"button_url": "https://thingsolver.com",
"image_url": "https://login.thingsolver.com/assets/ts-logo.png",
"validity_period": "48",
"validity_unit": "HOURS"
},
"end": false,
"next_block_name": "block_name_5"
},
{
"block_name": "block_name_5",
"block_type": "wait",
"period": "120",
"unit": "seconds",
"next_block_name": "block_name_6"
},
{
"block_name": "block_name_6",
"block_type": "choice",
"choice_rules": [
{
"attribute": "status",
"type": "string",
"operator": "=",
"value": "opened",
"next_block_name": "block_name_7"
}
],
"default_block_name": "block_name_7"
},
{
"block_name": "block_name_7",
"block_type": "message",
"block_description": "First Purchase Promotion",
"channel_type": "sms",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"sms_text": "Special offer just for you {{first_name}}!"
},
"end": true,
"next_block_name": ""
}
]
},
"flow_id": "flow-id-19b50f6c07b947cdbe74d3febbd16429",
"search_flow_name": "first purchase query duco",
"is_approved": false,
"is_active": false,
"channels": [
"email",
"viber",
"sms"
],
"date_created": "2024-06-10T12:35:33",
"date_modified": "2024-06-10T12:35:33"
}
Request approve automation
curl -X PUT https://dev.thingsolver.com/api/latest/automation-studio/flowsflow-id-19b50f6c07b947cdbe74d3febbd16429/approve
Response approve automation
{
"detail": "Automation flow with flow id flow-id-a1dbd7d1da6f4dd983247ffe98e37543, approved successfully!"
}
Request activate automation
https://dev.thingsolver.com/api/latest/automation-studio/flows/flow-id-a1dbd7d1da6f4dd983247ffe98e37543
Body:
{
"author": "Dusan Savic",
"is_active": true,
"flow_name": "Demo flow",
"start_date": "2024-06-15T16:00:00",
"end_date": "2024-06-25T16:00:00"
}
Response activate automation
{
"client_name": "dev",
"author": "Dusan Savic",
"flow_name": "Demo flow",
"goal": "improve-customer-experience",
"action": "send-welcome-message",
"start_date": "2024-06-15T16:00:00",
"end_date": "2024-06-25T16:00:00",
"max_allowed_contacts": 0,
"max_allowed_contact_frequency": 0,
"flow_rules": {
"entry_block": {
"block_name": "block_name_entry",
"block_type": "data-entry",
"data_entry_type": "api",
"attributes": [
{
"name": "email",
"operator": "is_present",
"value": "",
"type": "email"
},
{
"name": "phone_number",
"operator": "is_present",
"value": "",
"type": "phone_number"
},
{
"name": "first_name",
"operator": "not_equals_to",
"value": "",
"type": "string"
}
]
},
"flow_control": [
{
"block_name": "block_name_4",
"block_type": "message",
"block_description": "Send Welcome Message",
"channel_type": "viber",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"channel_text": "Welcome message just for you {{first_name}}!",
"button_text": "Offer",
"button_url": "https://thingsolver.com",
"image_url": "https://login.thingsolver.com/assets/ts-logo.png",
"validity_period": "48",
"validity_unit": "HOURS"
},
"end": false,
"next_block_name": "block_name_5"
},
{
"block_name": "block_name_5",
"block_type": "wait",
"period": "120",
"unit": "seconds",
"next_block_name": "block_name_6"
},
{
"block_name": "block_name_6",
"block_type": "choice",
"choice_rules": [
{
"attribute": "status",
"type": "string",
"operator": "=",
"value": "opened",
"next_block_name": "block_name_7"
}
],
"default_block_name": "block_name_7"
},
{
"block_name": "block_name_7",
"block_type": "message",
"block_description": "Send Welcome Message",
"channel_type": "email",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"subject": "Welcome message just for you!",
"template_id": "dev_20240409095023"
},
"end": false,
"next_block_name": "block_name_8"
},
{
"block_name": "block_name_8",
"block_type": "wait",
"period": "120",
"unit": "seconds",
"next_block_name": "block_name_9"
},
{
"block_name": "block_name_9",
"block_type": "choice",
"choice_rules": [
{
"attribute": "status",
"type": "string",
"operator": "=",
"value": "opened",
"next_block_name": "block_name_10"
}
],
"default_block_name": "block_name_10"
},
{
"block_name": "block_name_10",
"block_type": "message",
"block_description": "Send Welcome Message",
"channel_type": "sms",
"contact": {
"email": "$attributes.email",
"phone_number": "$attributes.phone_number"
},
"content": {
"sms_text": "Welcome message just for you {{first_name}}!"
},
"end": true,
"next_block_name": ""
}
]
},
"flow_id": "flow-id-a1dbd7d1da6f4dd983247ffe98e37543",
"search_flow_name": "demo flow",
"is_approved": true,
"is_active": true,
"channels": [
"viber",
"email",
"sms"
],
"date_created": "2024-06-11T08:45:53",
"date_modified": "2024-06-11T08:53:29"
}
Comments
0 comments
Please sign in to leave a comment.