API Documentation

Introduction

All requests require an API key. API keys are passed via the Authorization HTTP header:

Authorization: Bearer [**API Key**]

Projects

A project represents a campaign in ThankView.

List Projects:

Get a list of all the projects in your account.
Request
GET https://api.thankview.com/api/projects 
Content-Type: application/json
Authorization: Bearer [**API Key**]

Response
{
  "success": "true",
  "data": {
    "projects": [
      {
        "id": 1,
        "name": "Project 1",
        "created_by": "User 1"
      },
      {
        "id": 2,
        "name": "Project 2",
        "created_by": "User 2"
      }
    ]
  }
}

Recipients:

Recipients are the contacts within each project.

List Recipients:

Get a list of all recipients of a project. Set a limit parameter for the number of results per request (max 100). Set a page parameter to return results after a number of records. Add a search parameter to search by first name, last name, and email.
Request
GET https://api.thankview.com/api/recipient?project_id=1&limit=100&page=0&search=first 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 2",
        "last_name": "Last 2",
        "email": "email2@email.com"
      }
    ]
  }
}

Add Recipients:

Add a list of recipients to a project. Emails are unique per project. Recipients that have the same email will have their data updated with the latest information.
Request
POST https://api.thankview.com/api/recipient 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1", "recipients": [ { "title": "Title", "name": "First Name 1", "last_name": "Last Name 1", "preferred_name": "Nickname", "email": "email1@email.com", "notes": "", "donor_id": "1000001", "phone": "222-333-4444", "company": "ThankView", "last_donation": "100.00", "designation": "Alumni Fund" }, { "title": "Title", "name": "First Name 2", "last_name": "Last Name 2", "preferred_name": "Nickname", "email": "email2@email.com", "notes": "", "donor_id": "1000002", "phone": "333-444-5555", "company": "ThankView", "last_donation": "150.00", "designation": "Athletics Fund" } ] }
Response
{
  "success": "true",
  "data": {
    "updated": 1,
    "invalid": 0,
    "new_records": 1,
    "existing_records": 0,
    "ids": [1,2,3]
  }
}

Delete Recipient:

Delete a recipient from a project.
Request
DELETE https://api.thankview.com/api/recipient/{id} 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1" }
Response
{
  "success": "true"
}

Videos:

Upload videos to your portal and attach videos to recipients of a campaign.

List Videos:

Get a list of all videos in your portal. Set a limit parameter for the number of results per request (max 100). Set a page parameter to return results after a number of records. Add a search parameter to search by title, description, and tags.
Request
GET https://api.thankview.com/api/video?limit=100&page=0&search=title 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "videos": [
      {
        "id": 1,
        "title": "Title 1",
        "video_path": "https://media.thankview.com/video1.mp4",
        "description": "My first video"
      },
      {
        "id": 2,
        "title": "Title 2",
        "video_path": "https://media.thankview.com/video2.mp4",
        "description": "My second video"
      }
    ]
  }
}

Upload a Video:

Upload a video to your portal, mp4 file recommended. This can take some time especially with larger video sizes.
Request
POST https://api.thankview.com/api/video 
Content-Type: multipart/form-data; boundary=MultipartBoundry
Authorization: Bearer [**API Key**]

--MultipartBoundry
Content-Disposition: form-data; name="file"; filename="video.mp4"
Content-Type: video/mp4

rawvideocontent
--MultipartBoundry
Content-Disposition: form-data; name="title"

A new video
--MultipartBoundry
Content-Disposition: form-data; name="description"

Video description
Response
{
  "success": "true",
  "data": {
    "id": 5,
    "title": "A new video",
    "video_path": "https://media.thankview.com/video5.mp4",
    "description": "Video description",
    "tags": "tag1,tag2"
  }
}

Delete Video:

Delete a video from your portal.
Request
DELETE https://api.thankview.com/api/video/{id} 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true"
}

Attach Video To Recipients:

Attach up to 1,000 recipients to a video. Set the video id and ids of the recipients.
Request
POST https://api.thankview.com/api/video/attach 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1", "video_id": "2", "recipient_ids": [1,2,4,5] }
Response
{
  "success": "true"
}

Sends:

Schedule and sends ThankViews within a campaign.

List Statuses:

List a summary of the statuses of your sends within a campaign.
Request
GET https://api.thankview.com/api/send?project_id=1 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "ready_to_send": 2,
    "scheduled": 1,
    "sending": 0,
    "delivered": 2,
    "bounced": 0
  }
}

List Ready To Send:

List recipients ready to send within a campaign.
Request
GET https://api.thankview.com/api/send/readyToSend?project_id=1&limit=100&page=0 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      }
    ]
  }
}

List Scheduled:

List recipients that are scheduled within a campaign.
Request
GET https://api.thankview.com/api/send/scheduled?project_id=1&limit=100&page=0 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      }
    ]
  }
}

List Sending:

List recipients that are being sent within a campaign.
Request
GET https://api.thankview.com/api/send/sending?project_id=1&limit=100&page=0 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      }
    ]
  }
}

List Delivered:

List recipients that have been delievered a ThankView within a campaign.
Request
GET https://api.thankview.com/api/send/delivered?project_id=1&limit=100&page=0 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      }
    ]
  }
}

List Bounced:

List recipients that have been delievered a ThankView within a campaign.
Request
GET https://api.thankview.com/api/send/bounced?project_id=1&limit=100&page=0 
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "page": 0,
    "limit": 100,
    "recipients": [
      {
        "id": 1,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      },
      {
        "id": 2,
        "first_name": "First 1",
        "last_name": "Last 1",
        "email": "email1@email.com"
      }
    ]
  }
}

Send Now:

Send ThankViews to all of your recipients within a campaign immediately. You can not cancel any ThankViews that are sent immediately.
Request
POST https://api.thankview.com/api/send/now 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1", "recipient_ids": [1,2,4,5] }
Response
{
  "success": "true",
  "data": {
    "count": 3,
    "scheduled": "2020-04-30 12:00:00"
  }
}

Schedule:

Schedule ThankViews for all recipients within a campaign to send at a future date. The date must be in UTC timezone and in the format Y-m-d H:i:s.
Request
POST https://api.thankview.com/api/send/schedule 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1", "schedule": "2030-01-01 12:00:00", "recipient_ids": [1,2,4,5] }
Response
{
  "success": "true",
  "data": {
    "count": 3,
    "scheduled": "2030-01-01 12:00:00"
  }
}

Cancel Scheduled:

Cancel all scheduled ThankViews in a campaign. ThankViews that are sending can not be canceled.
Request
POST https://api.thankview.com/api/send/cancelScheduled 
Content-Type: application/json
Authorization: Bearer [**API Key**]
{ "project_id": "1", "recipient_ids": [1,2,4,5] }
Response
{
  "success": "true",
  "data": {
    "count": 3,
    "scheduled": "2030-01-01 12:00:00"
  }
}

Metrics:

Metric Details:

Get metrics for a single project.
Request
GET https://api.thankview.com/api/metrics?project_id=1&sent_start=YYYY-MM-DD&sent_end=YYYY-MM-DD
Content-Type: application/json
Authorization: Bearer [**API Key**]
Response
{
  "success": "true",
  "data": {
    "metrics": [
      {
        "project_id": 92,
        "project_name": "project 1",
        "project_type": "Thank Yous",
        "recorder_name": "name",
        "recipient_id": 8641,
        "title": "",
        "first_name": "First 1",
        "last_name": "Last 1",
        "sent_to": "email1@email.com",
        "email": "email1@email.com",
        "phone": "+12345678920",
        "stars": 3,
        "donor_id": "123",
        "birthday": "2021-03-16",
        "notes": null,
        "sent_date": "2021-03-12 16:48:08",
        "bounced": 0,
        "bounced_reason": null,
        "unsubscribe": 0,
        "unsubscribe_date": null,
        "reported_spam": null,
        "opened": 0,
        "opened_date": null,
        "clicked": 0,
        "watched_0": 1,
        "watched_25": 1,
        "watched_50": 1,
        "watched_75": 1,
        "watched_100": 0,
        "cta_clicked": 1,
        "views": 1,
        "downloads": 0,
        "shares": 0,
        "reply": null,
        "video_url": "https://dev-thankview.com/video/2601f32c2d4920?source=export",
        "video_download": "https://dev-thankview.com/videos-processed/final-601f32e84c7aa-139.mp4",
        "video_url_id": "2601f32c2d4920",
        "device": null,
        "city": null,
        "state": null,
        "country": null,
        "preferred_name": null,
        "company": null,
        "high_school": null,
        "graduation_year": null,
        "race": null,
        "major": null,
        "department": null,
        "address": null,
        "address2": null,
        "zip_code": null,
        "counselor": null,
        "sport": null,
        "interest": null
      }
    ]
  }
}