APIs Outbound
The Lynn Proactive module has a set of APIs that allow you to manage some of its functionalities; they are RESTful and require an authorization token.
Campaigns
Parameter | Description |
---|---|
GetCampaigns | Returns the list of campaigns associated with the Tenant. |
GetCampaign | Returns information about a campaign given the Tenant and the campaign ID. |
PostCampaign | Creation of a campaign. |
PutCampaign | Update a campaign. |
DeleteCampaign | Delete a campaign. |
StartCampaignExecution | Allows starting a campaign whose execution mode is Manua. |
StopCampaignExecution | Allows stopping a campaign whose execution mode is Manual. |
Contacts:
Parameter | Description |
---|---|
GetContacts | Returns the list of contacts associated with a Tenant. |
GetContact | Returns information about a contact given the Tenant and the contact ID. |
PostContact | Create a Contact. |
PutContact | Update a contact. |
DeleteContact | Delete a contact. |
Blacklist:
Parameter | Description |
---|---|
GetDnDContact | Returns a list with information about the campaign in which the contact is blacklisted. |
SetDnDContactByCampaign | Adds a contact to the blacklist for a specific campaign. |
SetDnDContactByCategory | Adds a contact to the blacklist for campaigns belonging to the same category. |
ManageDnDByCampaign | Bulk blacklist management. Adds contacts and updates the blacklist status for a campaign. Returns the task ID. |
GetDndTaskStatus | Returns information about the task, after executing the ManageDnDByCampaign method. |
Campaign Records
Parameter | Description |
---|---|
UploadCampaignDataByTenant | allows the creation of campaign records from a .cpg file (See Contacts_Template.cpg) |
Automatic Data Loading via API
Enables the loading of data lists through Lynn's Outbound API.
Prerequisites:
-
Create or use an established WhatsApp template:
For more information on how to create a template, please refer to the following documentation:
-
Create or use a token:
Users with an administrator profile can create a token. To carry out this process, please refer to the documentation:
Upon completing the prerequisites, the user must access the application environment to test the API, for example, "Postman," with the following URL, where they must complete the URL with the tenant number:
https://premium-production.lynn.cx/api/LynnService/AddCampaingData/{{Tenant}}
To carry out this process, the application (Postman) will request access with the token variable obtained in the prerequisites.
Next, proceed to configure the API body. This information will be obtained from the WhatsApp template being used via the "Json Request" button, which, through a notification, will indicate that it has been copied.
This JSON is dynamically constructed with the values of the template ID and the columns configured in the selected template in Lynn.
This information will be placed in the body of the code being worked on in the application (Postman).
"campaingId": "",
"templateId": "3c6f10ec-XXXX-XXXX-XXXX-21XX8fXX9XXX",
"typeOfData": 0,
"data": [
{
"Name": "Maiko",
"Phone": "56966666666",
"Tags": "5000",
"New Date": "03/05/2024",
"Store Name": "Altos las Condes",
"Order Number": "12345678",
"Coupon Number": "87654321",
"Coupon Days": "3"
},
{
"Name": "Camilo",
"Phone": "56955555555",
"Tags": "5500",
"New Date": "04/05/2024",
"Store Name": "Altos las Condes 2",
"Order Number": "12345",
"Coupon Number": "54321",
"Coupon Days": "5"
}
]
The user can review the status of this process at the following URL, where they must complete the URL with the tenant number and the taskID as appropriate:
https://premium-production.lynn.cx/api/LynnService/GetTaskStatus/{{Tenant}}/{{TaskID}}
Navigate to the Lynn platform and locate the campaigns icon, then navigate to the campaign data, where you can visualize the campaign records and their status. It will be observed that the process was completed successfully with the field 'Status':'200'.