This object allows you to create custom Campaigns. A Campaign is characterized by a set of rules, defined as a SQL query created in Redash and associated with the Campaign. A Campaign can be triggered at predefined intervals. For example, a Campaign can be triggered every day to add borrowers who are 30 days past due. Campaigns can also be manually triggered. When a Campaign is triggered by schedule or manually, a query is executed against the lender's replica data and returns a list of person IDs. The output is sent to the configured Contact Exporter to be written as a configurable CSV file with contact information required by auto dialers and other systems.
Get a list of campaign runs.
Success
{- "status": 0,
- "total": 0,
- "count": 0,
- "nextUrl": "string",
- "previousUrl": "string",
- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
]
}
Create a new campaign by associating a Redash query that returns a single column containing borrower IDs labeled "id". The campaign can also be scheduled.
(General (string or null)) or (bulkSender (string or null)) or (bulkSender: paymentDueDateReminder (string or null)) or (bulkSender: loanOverdueNthNotice (string or null)) or (bulkSender: autopayPaymentReminder (string or null)) or (bulkSender: loginFirstPaymentReminder (string or null)) or (bulkSender: autopayEnableReminder (string or null)) or (bulkSender: autopayAmountChanged (string or null)) or (bulkSender: futurepayPaymentDueReminder (string or null)) or (bulkSender: loanRightToCurePersonalUnsecured (string or null)) or (bulkSender: cardExpiresReminder (string or null)) | |
redashApiKey | string or null The API key to use for querying Redash. You can find your API key at https://{YOUR_REDASH_DOMAIN}/users/me. |
schedule | string or null The schedule to run a campaign on, given in Peachy crontab time specification format. Peachy crontab is an extension to crontab(5) that adds a time specification value 'P', which means "Peach decides". Currently, the minute and hour fields must be 'P' (i.e., you can not specify the time of the day), and the day-of-month, month, and day-of-week fields must NOT be 'P'. Some examples of Peachy crontabs:
See https://crontab.guru/ for an expression builder. If |
contactExporterId | string or null The ID of an existing contact exporter to use for this campaign. |
bulkSenderId | string or null The ID of an existing bulk sender to use for this campaign. |
object or null The SFTP settings to be used to upload the results of a campaign run. At the completion of a campaign run, if these settings are specified, they are used to SFTP upload the files created as a result of the run. These files include the exporter contacts .csv file and the log file. The file names for these files will be:
|
Success
{- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
{- "status": 0,
- "message": "string",
- "data": {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
}
Get a list of all campaigns.
Success
{- "status": 0,
- "total": 0,
- "count": 0,
- "nextUrl": "string",
- "previousUrl": "string",
- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
]
}
Get a campaign by ID.
Success
{- "status": 0,
- "message": "string",
- "data": {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
}
Update a campaign by ID.
(General (string or null)) or (bulkSender (string or null)) or (bulkSender: paymentDueDateReminder (string or null)) or (bulkSender: loanOverdueNthNotice (string or null)) or (bulkSender: autopayPaymentReminder (string or null)) or (bulkSender: loginFirstPaymentReminder (string or null)) or (bulkSender: autopayEnableReminder (string or null)) or (bulkSender: autopayAmountChanged (string or null)) or (bulkSender: futurepayPaymentDueReminder (string or null)) or (bulkSender: loanRightToCurePersonalUnsecured (string or null)) or (bulkSender: cardExpiresReminder (string or null)) | |
redashApiKey | string or null The API key to use for querying Redash. You can find your API key at https://{YOUR_REDASH_DOMAIN}/users/me. |
schedule | string or null The schedule to run a campaign on, given in Peachy crontab time specification format. Peachy crontab is an extension to crontab(5) that adds a time specification value 'P', which means "Peach decides". Currently, the minute and hour fields must be 'P' (i.e., you can not specify the time of the day), and the day-of-month, month, and day-of-week fields must NOT be 'P'. Some examples of Peachy crontabs:
See https://crontab.guru/ for an expression builder. If |
contactExporterId | string or null The ID of an existing contact exporter to use for this campaign. |
bulkSenderId | string or null The ID of an existing bulk sender to use for this campaign. |
object or null The SFTP settings to be used to upload the results of a campaign run. At the completion of a campaign run, if these settings are specified, they are used to SFTP upload the files created as a result of the run. These files include the exporter contacts .csv file and the log file. The file names for these files will be:
|
Success
{- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
{- "status": 0,
- "message": "string",
- "data": {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
}
Start a new borrower campaign run and save results.
The behavior of the campaign run is controlled by configured settings on
the campaign object and via the associated BulkSender
and ContextExporter
objects.
By default when the campaign runs, it executes the Redash query referenced in the
redashQueryUrl
and feeds the query results as input to the campaign run.
Optionally, you can override this by specifing a queryResultsOverride
field
as input.
Success
{- "queryResultsOverride": [
- {
- "borrowerId": 1,
- "loanId": 101
}, - {
- "borrowerId": 2,
- "loanId": 102
}, - {
- "borrowerId": 3,
- "loanId": 103
}
]
}
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "query_results.csv"
]
}
Get a list of campaign runs.
Success
{- "status": 0,
- "total": 0,
- "count": 0,
- "nextUrl": "string",
- "previousUrl": "string",
- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "string",
- "contactExporterId": "string",
- "bulkSenderId": "string",
- "sftpSettings": {
- "host": "sftp.acme.com:23",
- "username": "string",
- "password": "string",
- "cdDir": "string"
}
}
]
}
Update campaign run data.
Success
{- "status": "failed",
- "queryResultsFileId": "string",
- "campaignInputFileId": "string",
- "contactsOutputFileId": "string",
- "logFileId": "string",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "query_results.csv"
]
}
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "query_results.csv"
]
}
Get campaign run data by ID.
Success
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "query_results.csv"
]
}
Download files generated by a campaign run.
Success
Request sandbox access