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.
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.
externalId | string A lender's identifier for a campaign. After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object. To fetch the object using externalId you need to add Note: Don't add ext- to the identifier value. For example: if the external identifier is |
redashQueryUrl | string or null The URL of the Redash query from which to build the input list of borrowers. The URL should look like https://{YOUR_REDASH_DOMAIN}/queries/{QUERY_ID}. The query must produce a column named Note that on each execution of a campaign run a fresh list of borrowers is queried from this Redash query. |
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 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 |
Success
{- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "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"
}
}
Get a list of all campaigns.
Success
{- "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"
}
]
}
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"
}
}
Update a campaign by ID.
externalId | string A lender's identifier for a campaign. After the object is successfully created, a lender can use ID or externalId identifiers to fetch the object. To fetch the object using externalId you need to add Note: Don't add ext- to the identifier value. For example: if the external identifier is |
redashQueryUrl | string or null The URL of the Redash query from which to build the input list of borrowers. The URL should look like https://{YOUR_REDASH_DOMAIN}/queries/{QUERY_ID}. The query must produce a column named Note that on each execution of a campaign run a fresh list of borrowers is queried from this Redash query. |
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 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 |
Success
{- "externalId": "string",
- "redashApiKey": "string",
- "schedule": "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"
}
}
Start a new borrower campaign run and export results using the Campaign’s configured Contact Exporter
Success
{- "borrowerIds": [
- "string"
]
}
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "borrowers.txt"
]
}
Update campaign run data.
Success
{- "status": "failed",
- "borrowersInputFileId": "string",
- "contactsOutputFileId": "string",
- "logFileId": "string",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "borrowers.txt"
]
}
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "borrowers.txt"
]
}
Get campaign run data by ID.
Success
{- "status": "failed",
- "borrowerCampaignId": "string",
- "availableFiles": [
- "borrowers.txt"
]
}
Download files generated by a campaign run.
Success
Request sandbox access