Update a campaign by ID.
The API key to use for querying Redash.
You can find your API key at https://{YOUR_REDASH_DOMAIN}/users/me.
The URL of the Redash query from which to build the input.
The URL should look like https://{YOUR_REDASH_DOMAIN}/queries/{QUERY_ID}.
The output of this query is fed into the campaign system as input for each new campaign run. (Note that the query is re-run on each campaign run.)
The query must produce a query result with at least the column borrowerId, e.g.:
borrowerId
4,
5,
...Note that it is valid to use either public IDs (like BO-XXXX-XXXX) or internal database IDs (integers).
For a detailed description of how to format your query result see other options for this redashQueryUrl property.
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: P P 1,15 * *: Run on the 1st and 15th of every month P P * * wed: Run every Wednesday P P * 10 *: Run every day in October
See https://crontab.guru/ for an expression builder.
If null the campaign does not run on a schedule (and therefore must be run manually).
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:
{CAMPAIGN_ID}_{TIMESTAMP}_query_results.csv{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}.csv{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}.csv{CAMPAIGN_ID}_{EXPORTER_ID}_{TIMESTAMP}_log.txt
- oauth2
- bearerAuth
- apiKeyHeader
- General
- bulkSender
- bulkSender: paymentDueDateReminder
- bulkSender: loanOverdueNthNotice
- bulkSender: autopayPaymentReminder
- bulkSender: loginFirstPaymentReminder
- bulkSender: autopayEnableReminder
- bulkSender: autopayAmountChanged
- bulkSender: futurepayPaymentDueReminder
- bulkSender: loanRightToCurePersonalUnsecured
- bulkSender: cardExpiresReminder
curl -i -X PUT \
'https://sandboxapi.peach.finance/api/campaigns/{borrowerCampaignId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"bulkSenderId": "string",
"contactExporterId": "string",
"redashApiKey": "string",
"redashQueryUrl": "https://acme-rd.peach.finance/queries/48",
"schedule": "string",
"sftpSettings": {
"cdDir": "string",
"host": "sftp.acme.com:23",
"password": "string",
"username": "string"
}
}'Success
A borrower campaign is part of a system for exporting contact information for borrowers or sending communications to borrowers in bulk.
A borrower campaign objects represents this campaign. It contains the information specifying from where a campaign derives its input borrower list, a schedule for execution, and the format for exporting that list.
The input borrowers list is defined by a Redash query. See redashQueryUrl for details.
- General
- bulkSender
- bulkSender: paymentDueDateReminder
- bulkSender: loanOverdueNthNotice
- bulkSender: autopayPaymentReminder
- bulkSender: loginFirstPaymentReminder
- bulkSender: autopayEnableReminder
- bulkSender: autopayAmountChanged
- bulkSender: futurepayPaymentDueReminder
- bulkSender: loanRightToCurePersonalUnsecured
- bulkSender: cardExpiresReminder
{ "message": "string", "status": 0, "data": { "createdAt": "2019-08-24T14:15:22Z", "deletedAt": "2019-08-24T14:15:22Z", "id": "string", "updatedAt": "2019-08-24T14:15:22Z", "externalId": "string", "bulkSenderId": "string", "contactExporterId": "string", "redashApiKey": "string", "redashQueryUrl": "https://acme-rd.peach.finance/queries/48", "schedule": "string", "sftpSettings": { … } } }