1.1.7 • Published 2 years ago

@appflows/appflows v1.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

AppFlows

AppFlows is a low-code tool that helps you create smarter and more behavior-driven email automations for your product.

Visit us here at https://dashboard.appflows.com to create an account!

Installing

Npm

npm i @appflows/appflows

Features

  • Hyper Personalization: Personalize user experience with behavior-driven targeted emails.
  • Real-time Messaging: Engage with your customers at the right time in the user journey.
  • User Data and Insights: Deep dive into data and see how your users are interacting with the app.

Setting up the Client

To set up the client, you will need your API_KEY and SITE_ID.

The SITE_ID will be assigned to you automatically while setting up the account. This id will be a numeric value. Moreover, you can also extract this value from the page url **_dashboard.appflows.com/sites/siteId***

For the API_KEY, you will be asked to manually generate this key while setting up your account. This will be an alpha-numeric string with hyphens in between.

Used along with the SITE_ID for communication, note and save the API_KEY in a secure place and share it with no one as it is confidential.

import { Client } from @appflows/appflows

const AppFlowsClient = new Client({
  apiKey: process.env.APPFLOWS_API_TOKEN
  siteId: process.env.APPFLOWS_SITE_ID
})

//You will now be able to call the methods provided @appflows/appflows package
//The following method will create a new user for you
AppFlowsClient.createContact({
  email: "johndoe@test.com",
  list_id: 1024,
})

//export to use it throughout your code :)
export default AppFlowsClient

API Methods

You can use the following methods exposed for communicating the Appflows API

Contacts

The Contacts endpoint will help you manage your contacts. It provides the basic CRUD functionalities like create, get, update and delete.

createContact()

Params:
| Name | Type | Required | | ------ | ------ | ------ | | email | string | TRUE | | list_id | number | FALSE | custom_fields | object | FALSE

Response:

NameTypeExample
site_idnumber3581983
emailstringjohndoe@email.com
list_idnumber98391
created_atstring2022-06-22T06:55:54.192Z
updated_atstring2022-06-22T06:55:54.192Z
subscription_statusstringactive, cold, unconfirmed, unsubscribed, failed
unsubscribe_messagestring"Unsubscribed from the email"
custom_fieldsobjectcustom_fields: { "company": "XYZ Company" }

getContact()

Params:
| Name | Type | Required | | ------ | ------ | ------ | | id | number | TRUE |

Response:

NameTypeExample
site_idnumber3581983
emailstringjohndoe@email.com
list_idnumber98391
created_atstring2022-06-22T06:55:54.192Z
updated_atstring2022-06-22T06:55:54.192Z
subscription_statusstringactive, cold, unconfirmed, unsubscribed, failed
unsubscribe_messagestringnull
custom_fieldsobjectcustom_fields: { "first_name": "John" }

updateContact()

Params:
| Name | Type | Required | | ------ | ------ | ------ | | email | string | TRUE | | list_id | number | FALSE | custom_fields | object | FALSE

Response:

NameTypeExample
site_idnumber3581983
emailstringjohndoe@email.com
list_idnumber98391
created_atstring2022-06-22T06:55:54.192Z
updated_atstring2022-06-22T06:55:54.192Z
subscription_statusstringactive, cold, unconfirmed, unsubscribed, failed
unsubscribe_messagestringnull
custom_fieldsobjectcustom_fields: { "first_name": "Doe" }

deleteContact()

Params:
| Name | Type | Required | | ------ | ------ | ------ | | email | string | TRUE |

Response:

NameTypeValue
messagestring"Contact deleted successfully"

Events

The Events endpoint will allow you to trigger events for your contacts. Based on these events, you can send emails to these contacts and do multiple other actions using our Automation Builder.

logEvent()

Params:
| Name | Type | Required | | ------ | ------ | ------ | | name | string | TRUE | | contact.email | string | TRUE | | contact.list_id | number | FALSE | | contact.custom_fields | object | FALSE |

Response:

NameTypeValue
successbooleantrue, false

Default Custom Fields

By default, we provide the following custom fields. These can be used for storing custom data.

You can pass the custom_fields object body parameters while making a request as shown below,

{
  name: 'your_event_name',
  contact: {
    email: "johndoe@test.com",
    list_id: 1024,
    custom_fields: {
      first_name: "John",
      last_name: "Doe",
      company: "John's Company",
      zip_code: "12000"
    }
  }
}
NameSlug
Emailemail
Namename
First Namefirst_name
Last Namelast_name
Phone Numberphone_number
Companycompany
Websitewebsite
Zip Codezip_code

Further Documentation

For further API Reference, please visit
https://appflows.readme.io/reference/getting-started

1.1.7

2 years ago

1.1.6

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.8

2 years ago