1. Create template and automation Main
- To get started log in to your Main account on Spoki and create a parent automation that has as a step sending a template
2. Create automation and templates in the client’s Spoki (or secondary)
- Complete the Spoki platform activation process for the client
- You will see the new account in the “Customer Overview” of your Spoki
- Clone the parent automation into the account
- This will automatically send the template to WhatsApp for client approval
- Creates an API startup step for the automation you just created
- A Secret => will be generated for this startup step, copy it and associate it with the user on your DB
3. Implement API on Main Account to control whether user can send messages
- Ask Spoki support for Agency ID and External_APIKey related to your Main account:
- on the Main account implements theRetrieve agency API which will return all your clients to you with various information including estimated_available_conversations
- inviduaiton of the customer via their account ID (which you can also find in the Spoki Customer Overview)
- estimated_available_conversations indicates how many new people you can contact with the next step
4. Implement the automation startup API in Mooving.
- at this point you are ready to implement the API that allows you to send the message on behalf of your client so that they send from their number and use their credit
- on the Main account implements theStart Automation for many contacts API: here you can easily start automation for one or more recipients, below is an example template / API:
Template:Hello %%FIRST_NAME%%, your subscription will expire on %%DATE_EXPIRE_SCRIPTION%%. Renew it now!
Bees:{
“secret”: “{{secret}}”,
“contacts”: [
{
“phone”: “+393331234567”,
“first_name”: “Mario”,
“last_name”: “Rossi”,
“email”:“mario.rossi@domain.com”,
“custom_fields”: {
“DATA_SCADENZA_ABBONAMENTO”: “2022-11-10T18:00:00.000Z”
}
},
{
“phone”: “+39333123461234”,
“first_name”: “John”,
“last_name”: “Bianchi”,
“email”:“giovanni.bianchi@domain.com”,
“custom_fields”: {
“DATA_SCADENZA_ABBONAMENTO”: “2022-11-10T18:00:00.000Z”
}
}
]
}
- sending messages is asynchronous, so the system will return 200 OK to you if it has taken them in, sending will be done by Spoki asynchronously