Reports
Segment-based Reports and Bulk Actions
Section titled “Segment-based Reports and Bulk Actions”Segments are pre-defined “views” of your data. You can create a segment from almost any data type, and the report will only show data that matches the segment’s filter rules. The Sheep system comes with a large number of automatic segments created for common use cases. You can also create your own segments.
Requesting a Report/Action
Section titled “Requesting a Report/Action”Reports are asynchronous — you must request the report and then come back once it has been processed. The report file will be stored on Amazon S3 when it is ready.
| Parameter | Description |
|---|---|
template | Optional. Dictates which fields are visible in the report. |
policy | Optional. The security policy for the report. Only needed if you wish to export fields beyond the usual security policies. |
gdpr_bypass | Optional. Defaults to False. Set True to bypass GDPR checking. |
gdpr_bypass_reason | Required if GDPR bypass is set. You must provide a reason. |
gdpr_channel | Optional. For PDF reports: process (default), post, email. |
GET https://sls-api.sheepcrm.com/segments/v2/example/segment/{uid}/all/{format}/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "bucket": "example", "journal_uri": "/example/journal/634db79....d005c2a/", "lambda_prefix": "sheepcrm-reports", "policy": "membership", "report_format": "xlsx", "template": "/example/template/634d41.....63821e1a/", "uid": "634d38a....21d46", "use_mapreduce": true, "user_uri": "/sheepcrm/user/554b31....00a4b4/"}The journal_uri in the response is the URI of a notification/reminder/task created for the user. The notification is created with a “preparing” title and will be updated with the report’s status and the S3 link when it is ready to download. If the report fails, the notification will be updated with the error message.
Report Types
Section titled “Report Types”Excel / XLSX
Section titled “Excel / XLSX”Use Excel reports to get access to the underlying data:
{segment_uri}/all/xlsx/Use PDF reports to get printable versions of the data. PDF templates can be user generated content or a fixed format report:
{segment_uri}/all/pdf/Built-in PDF templates
Section titled “Built-in PDF templates”| Template | Size | Description |
|---|---|---|
sheep-card-standard | 8.51 x 5.51 cm | Simple membership card |
sheep-receipt-a5 | A5 Landscape | Payment receipt |
sheep-membership-certificate-a4 | A4 Portrait | Membership certificate |
sheep-invoice-a4 | A4 Portrait | Invoice |
Address label templates
Section titled “Address label templates”| Template | Size | Description |
|---|---|---|
avery-3478 | 1 x 1 | Address labels |
q-connect-kf26050 | 1 x 1 | Address labels |
q-connect-kf26056 | 1 x 2 | Address labels |
q-connect-kf02246 | 2 x 2 | Address labels |
q-connect-kf71461 | 2 x 3 | Address labels |
q-connect-kf26055 | 2 x 4 | Address labels |
q-connect-kf26053 | 2 x 8 | Address labels |
q-connect-kf26052 | 3 x 6 | Address labels |
q-connect-kf26054 | 2 x 7 | Address labels |
q-connect-kf26051 | 3 x 7 | Address labels |
q-connect-kf26071 | 3 x 8 | Address labels |
avery-3652 | 3 x 7 | Address labels |
avery-3653 | 2 x 7 | Address labels |
avery-3653-p | 2 x 7 | Address labels |
avery-3484 | 2 x 8 | Address labels |
avery-3427 | 4 x 2 | Address labels |
avery-3475 | 8 x 3 | Address labels |
avery-3425 | 5 x 2 | Address labels |
avery-3483 | 2 x 2 | Address labels |
avery-3663 | 5 x 13 | Address labels |
ryman-p16-universal-99x34mm | 2 x 8 | Address labels |
For the full list of labels see the API call below.
Available Labels
Section titled “Available Labels”GET https://sls-api.sheepcrm.com/reports/v2/pdf/address_labels/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "avery-3425": { "height": 5.7, "name": "avery-3425 (5 x 2)", "unit": "cm", "width": 10.5 }, "avery-3427": { "height": 7.4, "name": "avery-3427 (4 x 2)", "unit": "cm", "width": 10.5 }}Available Membership Certificates
Section titled “Available Membership Certificates”| Parameter | Description |
|---|---|
bucket | Optional. Pass the bucket (flock identifier) for additional custom certificates. |
GET https://sls-api.sheepcrm.com/reports/v2/pdf/membership_certificates/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "sheep-membership-certificate-a4": { "height": 29.7, "name": "sheepCRM A4 portrait", "unit": "cm", "width": 21.0 }}Available Letter Templates
Section titled “Available Letter Templates”| Parameter | Description |
|---|---|
bucket | Required. |
GET https://sls-api.sheepcrm.com/reports/v2/pdf/letters/Authorization: Bearer $API_KEY
HTTP/1.0 200 OK{ "/example/template/63490b08fa78f4fa203eedea/": { "height": 29.7, "name": "Thank you for your completed membership application", "unit": "cm", "width": 21.0 }, "/example/template/634d41ddcffe37f863821e1a/": { "height": 29.7, "name": "Subscription Renewal PDF", "unit": "cm", "width": 21.0 }}Mailchimp Segment Export
Section titled “Mailchimp Segment Export”Create a one-off Mailchimp segment from the Sheep segment:
{segment_uri}/all/sync_mailchimp/| Parameter | Description |
|---|---|
name | Optional. Name of the Mailchimp segment (will be prefixed by sheepCRM segment:). Defaults to the segment name if not provided. |
Sending Messages to a Segment
Section titled “Sending Messages to a Segment”| Parameter | Description |
|---|---|
segment_uri | Required. The segment URI. |
template | Required (unless subject and body are provided). Template to use for the message. |
subject | Required (unless template is provided). Subject of the email. |
body | Required (unless template is provided). Body of the message. |
gdpr_bypass | Optional. Set to true to bypass the GDPR checks. |
message_type | Optional. Default = “email”. Can be “sms”, “email”, “in-app” or “post” (bulk post not yet implemented). |
POST https://api.sheepcrm.com/api/v1/example/reports/segment_email_builder/Authorization: Bearer $API_KEYContent-Type: application/json
{ "segment_uri": "/example/segment/632c65beb05d1aa53ac6b923/", "subject": "test 1", "body": "hi {{first_name}}"}
HTTP/1.1 200 OK{ "bad": 9, "duplicate": 0, "message": "/example/message/637e3cf3b443397649e785de/", "missing": 0, "num_contacts": 66, "query": { "membership_record_status": "active", "exact": true, "mode": "AND" }, "segment_uri": "/example/segment/632c65beb05d1aa53ac6b923/", "skipped": 0}