Shares

This API allows you to create offer shares.


POST /offers/<short_url_code>/shares/social

Creates a social share.

Parameter

Description

site_slug

Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.

short_url_code

Offer short code obtained with origin creation.

channel

Options: facebook, twitter, linkedin, whatsapp, sms, other


POST /offers/<short_url_code>/shares/email

Creates an email share.

Parameter

Description

site_slug

Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.

short_url_code

Offer short code obtained with origin creation.

recipients

List of recipient emails separated by comma or newline.

subject

(optional) Custom subject of the email

body

(optional) Custom message added to the email body

reminder

(optional, true/false, true by default) Whether Talkable should send a reminder email later

Example

Create a Facebook share

curl -H "Content-Type: application/json" \
     -X POST \
     -u i9uil7nQgDjucCiTJu: \
     -d '{"site_slug":"my-store","channel":"facebook"}' \
     https://www.talkable.com/api/v2/offers/dZpBwd/shares/social

Sample response:

{
  "ok": true,
  "result": {
    "share": {
      "id": 4452084,
      "type": "SocialOfferShare",
      "short_url": "https://www.talkable.com/x/hQ0SZb"
    },
    "reward": {
      "id": 24,
      "reason": "shared",
      "incentive_type": "discount_coupon",
      "incentive_description": "shared coupon \"C1383-8321\" for $10 off",
      "incentive_custom_description": null,
      "amount": 10.0,
      "coupon": {
        "id": 951,
        "code": "C1383-8321",
        "active": true,
        "valid_until": null,
        "single_use": true,
        "used": false,
        "usages": 0,
        "amount": 10.0,
        "percentage_discount": false,
        "description": "$10",
        "expires_at": null
      },
      "coupon_code": "C1383-8321",
      "status": "Paid"
    }
  }
}

Create an Email share

curl -H "Content-Type: application/json" \
     -X POST \
     -u i9uil7nQgDjucCiTJu: \
     -d '{"site_slug":"my-store","recipients":"friend1@example.com,friend2@example.com","subject":"Hello!","body":"World!","reminder":false}' \
     https://www.talkable.com/api/v2/offers/dZpBwd/shares/email

Sample response:

{
  "ok": true,
  "result": {
    "success": true,
    "validation_only": false,
    "stats": {
      "currently_sent": 2,
      "currently_not_sent": 0,
      "previously_sent": 0,
      "total_sent": 2,
      "sent_limit_exceeded": false,
      "left_emails": 20
    },
    "recipients": {
      "friend1@example.com": {
        "currently_sent": true,
        "previously_sent": false,
        "email_valid": true,
        "self_referral": false,
        "unsubscribed": false,
        "blacklisted": false,
        "meets_criteria": true,
        "sharable": true
      },
      "friend2@example.com": {
        "currently_sent": true,
        "previously_sent": false,
        "email_valid": true,
        "self_referral": false,
        "unsubscribed": false,
        "blacklisted": false,
        "meets_criteria": true,
        "sharable": true
      }
    },
    "reward": null
  }
}