How to use the Prefinery API with No-code Automation Tools
What are no-code automation tools
No-code automation tools, sometimes referred to as no-code integration platforms, are service-as-a-software that allow you to build integrations between two or more apps/services to make them communicate data between each other even without programming knowledge (hence the "no-code") due to elements being presented to you in a graphical user interface.
This allows you to integrate apps that doesn't have native integration support between each other, or create automations that aren't normally available out-of-the-box, without writing a single line of code from scratch.
Examples of such tools are Zapier, Make, and few others.
But, you might find that these automation tools lack support for an action or a "do this" step you're looking for, or perhaps a custom action - for example, to update the information of an existing user in Prefinery if something has changed in their Mailchimp list profile.
That is where using the Prefinery REST API with such tools comes in so you'll be able to make full use of all available API calls, especially for actions not natively supported by your no-code automation tool.
Things you need
To be able to setup this kind of integration, you'll need the following:
- A Prefinery company account that's at least on the Essentials plan as this requires access to the API.
- The third-party app/service which you'll be using as the data source, automation trigger, or first step of the integration. In other words, the app/service you'd like to connect with your Prefinery project.
- Your no-code automation tool of choice that supports HTTP requests as listed in the next section.
No-code automation tools that supports HTTP requests
List of no-code automation tools that supports HTTP requests and their corresponding integration step/module/app to use:
- Zapier = Webhooks by Zapier (action step)
- Make = HTTP app (module)
- Pabbly Connect = API by Pabbly (action step)
- Integrately = Webhook / API Integration (app)
- SyncSpider = External API (integration)
As much as possible, we recommend that you use the supported, available native trigger and action steps of your no-code automation tool before opting for the following webhooks and API options. Native triggers are usually easier to setup.
Using the API via HTTP methods
For receiving event data from Prefinery to use as your automation trigger, you can use our webhooks. For example, if you need to know the email address of a newly signed up user.
Integration tools like Zapier usually natively supports Prefinery triggers so there's no need to setup our webhooks as the trigger, but it's an option for you especially if here's a trigger that the tool doesn't support but our webhooks does like User Imported
, User Deleted
, or Referral Created
.
After having setup the trigger or first step of your automation, and for sending data to Prefinery (e.g. to use as an action step in your workflow), you can use our API. An API request allows you to retrieve data from Prefinery, or to send data to it.
Nearly all Prefinery API requests requires your project's API Beta ID and an API key with the correct permissions.
You can find your API Beta ID from your project dashboard as shown below:
For your API key, please see: Enabling Prefinery API Access
Each API request uses an HTTP method. The most common methods are GET, POST, PATCH, PUT, and DELETE.
While examples/screenshots below show setups made in Zapier, the implementation is very similar with that of other automation tools that supports HTTP requests, especially when it comes to the use of the request URL, API key, parameters, and JSON data.
With Zapier in particular, except for GET requests, you may need to use a Custom Request for other request types (POST, PUT, PATCH, DELETE) though you can also do the same for GET requests:
- SHOW project - get general data about a project like users count, etc.
- LIST user - query users by email address; use to get User ID
- SHOW user - get data about a user; requires User ID
- LIST reward - query rewards by email address; use to get Reward ID
- SHOW reward - get data about a reward; requires Reward ID
- LIST suppression - query suppressions by email address; use to get Suppression ID
- GET suppression - get data about a suppression; requires Suppression ID
- CREATE user - add user to a project
- CHECKIN user - set user's status to
Active
; requires User ID - TRIGGER rewards - evaluate custom event data and trigger rewards
- CREATE reward - manually reward a user
- CREATE suppression - add email address to suppression list
- CREATE friend invitation - invite new person in behalf of existing user
- CREATE points - manually issue points to a user
- UPDATE user - update data of existing user; requires User ID
- UPDATE status - update status of a user's earned reward; requires Reward ID
- DELETE project - delete a project from your account
- DELETE user - delete user from a project; requires User ID
- DELETE suppression - remove email address from suppression list
How to make a GET request
GET methods retrieve data from an API about an entity (e.g. user, reward).
Here's a list of GET requests you can perform with our API:
SHOW beta/project - Get information about a project by its API Beta ID.
LIST tester/user - Get information about users in your project. Optional query parameters allow you to be specific on which user you need to get information from by using their name or email address as query input.
You can use this GET request to know the user ID which can be a required input for other request types.
SHOW tester/user - Get information about a user in a project by their User ID. You can map the User ID from the result/output of a previous step.
LIST reward - Get information about rewards in your project. Optional query parameters allow you to be specific on which user you need to get reward information from by using email address as query input as well as the status of the reward.
SHOW reward - Get information about a reward in a project by its Reward ID. You can map the Reward ID from the result/output of a previous step.
LIST suppression - Get information about suppressions in your project. Optional query parameters allow you to be specific on which user you need to get suppression information from by using their email address as query input.
How to make a POST request
POST sends new data to an API.
To setup a POST request step in your automation tool, you may need to use a Custom Request:
Here's a list of POST requests you can perform with our API:
CREATE tester/user - Add a new user in a project. You can use different parameters to specify information about the user. Email address is required to add the user.
Make sure to set the correct Content-Type
as application/json
in the Headers:
CHECKIN tester/user - When an existing user is checked in by their User ID or email address, their status in your project will be set to Active
, identifying them as having accepted your beta invitation. Regularly making this request is also a great way to track visits and retention over time.
To check in a user by their User ID:
To check in a user by their email address:
For either options, make sure to set the correct Content-Type
as application/json
in the Headers:
TRIGGER rewards - By sending a referred user's email address and performed custom event (both are required), Prefinery evaluates if a reward has such custom event requirement and if it does counts the referral towards that reward. If it's the last needed referral, that reward is earned by the referrer.
Make sure to set the correct Content-Type
as application/json
in the Headers:
CREATE reward - Manually grant a specific reward to a user. Requires the user's email address and the reward's descriptor (edit your reward to get its descriptor value), with the option skip reward quantity check (force the reward to be issued to the user, even if they have already received the maximum quantity).
In most cases you will want to use the TRIGGER endpoint instead, which automatically issues rewards when a person performs a goal-based action. Only use this CREATE endpoint if you want to manually issue a specific reward to someone.
Make sure to set the correct Content-Type
as application/json
in the Headers:
CREATE suppression - Add an email address to the suppressions list. Requires the user's email address and a reason (type of suppression).
Make sure to set the correct Content-Type
as application/json
in the Headers:
CREATE friend invitation - Invite a new user (haven't joined your project yet) on behalf of an existing invited
, active
or idle
user using our Invite-a-Friend System. Requires the email addresses of both inviter and invitee, and optionally a message to the invitee.
Make sure to set the correct Content-Type
as application/json
in the Headers:
CREATE points - Manually issue points to a user. Requires that your project's waitlist/leaderboard algorithm has been set to "Order by most points".
Make sure to set the correct Content-Type
as application/json
in the Headers:
How to make a PUT request
PUT methods update existing entity data with a modified version of it, replacing the current one.
To setup a DELETE request step in your automation tool, you may need to use a Custom Request:
Here's a list of PUT requests you can perform with our API:
UPDATE tester/user - Update an existing user in a project by their User ID. You can map the User ID from the result/output of a previous step. This request can be used to change a user's status and profile information.
Make sure to set the correct Content-Type
as application/json
in the Headers:
How to make a PATCH request
PATCH methods works similar to PUT, but instead of having to replace an existing data it is used to apply a partial update or change.
To setup a PATCH request step in your automation tool, you may need to use a Custom Request:
Here's a list of PATCH requests you can perform with our API:
UPDATE reward status - Mark an earned
reward as delivered
or revoked
by its Reward ID. You can map the Reward ID from the result/output of a previous step.
Make sure to set the correct Content-Type
as application/json
in the Headers:
How to make a DELETE request
DELETE removes existing data.
To setup a DELETE request step in your automation tool, you may need to use a Custom Request:
Here's a list of DELETE requests you can perform with our API:
DELETE beta/project - Delete a project by its API Beta ID.
DELETE tester/user - Delete an existing user from a project by their User ID. You can map the User ID from the result/output of a previous step.
DELETE suppression - Delete a Manual
or HardBounce
suppression by Suppression ID, and reactivate the email address for email delivery. You can map the Suppression ID from the result/output of a previous step.
Limitations
Please note that there are limitations when solely relying on the API via no-code automation tools.
For example, when creating a new user in your Prefinery project using this method, unlike the recommended method of installing Prefinery on your website, the API alone won't be able to track shares.