Sometimes you want to do something specific with the Salesflare API, and the ready-made zaps are not enough. For those times, there's "Webhooks by Zapier".
Webhooks by Zapier can be used to do anything on Salesflare's public API. I'll explain you how.
0. Before we get started: what is an API? π
An API is an Application Programming Interface.
It's the way software talks to other software. Apps talking to servers. Servers talking to each other.
It's software's mouth AND ears.
Let's go:
1. Use Webhooks by Zapier
Easy. Just search "webhooks" or "zapier". Select. Next. π
2. Choose the right method
There's four basic methods you can use on Salesflare's REST API:
GET: get objects
PUT: put info into objectsΒ
POST: create new objects
DELETE: delete objects
DELETE is not available in Webhooks by Zapier. What is however possible is a custom request. Like Zapier writes "very flexible but unforgiving".
3. Configure the request
Let me quickly run you through the fields.
β
βURL: Specify the endpoint that you want to use. π
Some examples:
https://api.salesflare.com/messages (POST)
https://api.salesflare.com/accounts (GET, POST)
https://api.salesflare.com/contacts/{contact_id} (GET, PUT)
Just check out the possibilities in the docs.
If it says something like {contact_id} above, you need to specify an id. This can be filled with a Zapier merge tag.
Payload type: Pick "Json". That's it! β
Data: This is where the magic happens.Β
Here you can specify the data you want to pass to Salesflare, when doing a PUT or POST.
Data always comes in keys and values. The key is the name of the field/attribute, the value is the content.
Here's some examples of what you can do on an account (key : value) :
name : Salesflare
domain : salesflare.com
phone_numbers : [{"type":"work","number":"+32499217782"},{"type":"work","number":"+32496725080"}]
Again, all the possibilities are in the docs.
Things like arrays of phone numbers are not well described there. If you want to use this, you can check out the app's calls in the developer console. Or just talk to us in the chat.
To pass custom fields, use "custom__fieldname" (double underscore between custom and fieldname). Field names are transformed like this:
everything is made lowercase
spaces become underscores
special characters and emoji are not removed π
Another specificity: when doing a PUT and passing an array of objects, you need to use the following extra key:value combination in every object "_dirty":"true". For example:
phone_numbers : [{"type":"work","number":"+32499217782","_dirty":"true"},{"type":"work","number":"+32496725080","_dirty":"true"}]
Yes, magix π
Wrap Request in Array: Usually, this has to be "no". Unless you are creating an account from a contact, then the API expects an array of contacts.
File: Don't touch π
Unflatten: Yes! π This is handy if you want to pass things like custom fields.
Basic Auth: Not applicable here. Auth is done in the headers below. π
Headers: This is where you authenticate with the Salesflare API.
Naturally, you need to assure Salesflare that it's you. For this you need an API key. π It's your secret password. You can create an API key from Settings > API key.
Just pass it as follows (key : value) :
Authorization : Bearer {APIKEY}
Here's a full example:
4. Testing time!
Is it successful? Or do you get an error? π
Let us know via the chat if the error is incomprehensible. We'll look at it with you.
Have fun automating! π€π