About the REST API

Now that you've learned how to configure your Platform Account, you're ready to display your content. This document describes the TwineSocial REST API, which is a robust way to design engaging social applications using common scripting languages such as PHP, Python, or Ruby.

Generally, the TwineSocial REST API works by providing endpoint that you can use to integrate social media content into your HTML document. From here, you can apply your own CSS and Javascript to further manipulate your content, creating a seamless experience for the end user.

This document describes the configuration and display options available for retrieving, rendering, and reporting on engagements using the REST API.


Making API Requests

To make a request to the REST API, format a HTTP GET request to a named endpoint. For example, to retrieve contentItems from the louboutin campaign:

curl https://apps.twinesocial.com/api/v1/content?campaign=louboutin

API Authentication

Some API endpoints—such as createPost and postVote—require authentication via your API client_id. These are clearly marked in the documentation with the  Requires Auth badge.

curl https://apps.twinesocial.com/api/v1/content?campaign=louboutin&client_id=YOUR_CLIENT_ID

You can find your client_id in the API section of your TwineSocial account admin. While logged into your account, simply navigate to the Account section on the left, then choose API. In the REST API area select your client_id.

 Please note: Never expose your client_id to the public. Doing so will allow bad actors to manipulate your TwineSocial data using these endpoints. For this reason browser-side implementations of endpoints using the client_id are strongly discouraged. Also, for the best security of your client_id and data we require that all API calls use HTTPS. If you ever think you have exposed your client_id you can generate a new one in the TwineSocial admin.


Endpoints


Campaign GET

The campaign endpoint is used to retrieve properties for a specified campaign. Returns a single campaignItem.

curl https://apps.twinesocial.com/api/v1/campaign?id=louboutin
$ch = curl_init("https://apps.twinesocial.com/api/v1/campaign?id=louboutin");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->name;
id
string (required) Example: louboutin

The campaign name to retrieve properties for.

{
  "success": true,
  "campaign": {
    "name": "Louboutin",
    "status": "Active",
    "statusId": 1
  },
  "performance": 0.04
}

Collections GET

The collections endpoint is used to list the collectionItems for a campaignItem. Use this to create dynamic UI elements based on collections defined in your campaign.

curl https://apps.twinesocial.com/api/v1/collections?campaign=louboutin
$ch = curl_init("https://apps.twinesocial.com/api/v1/collections?campaign=louboutin");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->name;
campaign
string (required) Example: louboutin

The campaign name to retrieve collections from.

{
  "success": true,
  "collections": [
    {
      "id": 83551,
      "name": "Black Shoes"
    },
    {
      "id": 83552,
      "name": "Red Shoes"
    },
    {
      "id": 83553,
      "name": "Tan Shoes"
    }
  ],
  "count": 3,
  "performance": 0.17
}

Create Collection  Requires Auth  POST

The createCollection endpoint is used to create a campaign. Your POST request’s Content-Type should be set to multipart/form-data.

curl -d "client_id=YOUR_CLIENT_ID&campaign=CAMPAIGN_NAME&collection=NEW_COLLECTION_NAME" https://apps.twinesocial.com/api/v1/createCollection
$url = 'https://apps.twinesocial.com/api/v1/createCollection';
$data = array('campaign' => 'CAMPAIGN_NAME', 'collection' => "NEW_COLLECTION_NAME", 'description' => 'Hello World', 'client_id'=> "add-your-client-id-here");

$params = http_build_query($data);

$url = stream_get_contents(fopen($url, "rb"));
campaign
string (required) Example: louboutin

The name of the campaign for which you want create this collection.

collection
string (required) Example: Team

The new collection name.

description
string (optional) Example: "My new #TwineTeam"

Description text associated with this collection.

{
    "success":true,
    "message":"Collection created successfully."
  }

Content GET

The content endpoint is used to list all the contentItems for a campaign. Use this API endpoint to retrieve one or more social media posts for a campaign.

curl https://apps.twinesocial.com/api/v1/content?campaign=louboutin
$ch = curl_init("https://apps.twinesocial.com/api/v1/content?campaign=louboutin");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->name;
campaign
string (required) Example: louboutin

The campaign name to retrieve content from.

collection
number (optional) Example: 18132

Optionally limits the results to a collection ID inside the campaign.

network
string (optional) Example: twitter

Optionally limits the results to only posts from a given network inside the campaign.

photosOnly
boolean (optional) Example: true

Optionally limits the results to items that contain a photo.

includePromoted
boolean (optional) Example: true

Optionally include a campaign's promoted posts.

name
string (optional) Example: John

Optionally include a search for a username in your API call. Returns content items with from_user_name or from_full_name fields matching your value. Left and right hanging wildcards will be added to your search. Searches including spaces must be url encoded.

 Please note This paramater is only available if you have indexed name scanning enabled on your account.

status
string (optional) Default: active Example: modpending

Optionally limits the results to contentItems with a particular status. Available statuses:

active
Only get published items
modpending
Only get unpublished items waiting moderation
moderated
Only get unpublished items that were moderated out
brokenlink
Only get items unpublished items containing a link to a bad image URL
filtered
Only get unpublished items that were filtered out by a profanity or content filter

 Authentication  You must include authentication on requests for statuses other than active.

sort
string (optional) Default: date-desc Example: date-asc

Optionally sort data contentItems by a particular value. Available sort types:

date-asc
Order oldest to earliest.
vote-asc
Order posts with fewest to posts with most votes.
vote-desc
Order posts with most to posts with fewest votes.
limit
number (optional) Default: 20 Example: 10

Maximum number of items to retrieve, up to a maximum of 100.

id
number (optional) Example: 32036227

A comma-delimited list of post IDs to retrieve. Used to retrieve detail about a one or more contentItems.

Cannot be combined with collection, limit, status, or offset.

offset
number (optional) Example: 10

Optionally offset the result set. Used for pagination.

{
  "success": true,
  "rows": [
    {
      "id": 37447240,
      "media_key": "910956065087120103_11285087",
      "feed_id": 135946,
      "from_user_name": "louboutinworld",
      "from_full_name": "Christian Louboutin",
      "network_id": 1,
      "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_11285087_75sq_1363347869.jpg",
      "media_type_id": 2,
      "perma_link": "a-louboutin-woman-has-style-be",
      "source": "Instagram",
      "network_css": "instagram",
      "official_brand_url": "https:\/\/instagram.com",
      "votes": 53198,
      "image_width": 640,
      "image_height": 640,
      "status": 1,
      "providerName": null,
      "providerThumbUrl": null,
      "created_at": 1422814447,
      "title": "",
      "description": "A Louboutin woman has style, beauty... and balance.",
      "target_url": "https:\/\/instagram.com\/p\/ykXbb5gWLn\/",
      "image_url": "https:\/\/scontent-b.cdninstagram.com\/hphotos-xaf1\/t51.2885-15\/e15\/10948756_1545595462379676_1727815357_n.jpg",
      "resource_url": null,
      "is_retweet": false,
      "network": {
        "id": 1,
        "brand_url": "https:\/\/instagram.com",
        "css_class": "instagram",
        "name": "Instagram"
      },
      "layout": {
        "id": 1,
        "name": "Full",
        "css": "layout-full"
      }
    },
    {
      "id": 37349366,
      "media_key": "910352920153776672_11285087",
      "feed_id": 135946,
      "from_user_name": "louboutinworld",
      "from_full_name": "Christian Louboutin",
      "network_id": 1,
      "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_11285087_75sq_1363347869.jpg",
      "media_type_id": 2,
      "perma_link": "tis-the-season-for-love-loubou",
      "source": "Instagram",
      "network_css": "instagram",
      "official_brand_url": "https:\/\/instagram.com",
      "votes": 80381,
      "image_width": 640,
      "image_height": 640,
      "status": 1,
      "providerName": null,
      "providerThumbUrl": null,
      "created_at": 1422742546,
      "title": "",
      "description": "'Tis the season for love. #LouboutinWorld",
      "target_url": "https:\/\/instagram.com\/p\/yiOShaAWIg\/",
      "image_url": "https:\/\/scontent-a.cdninstagram.com\/hphotos-xaf1\/t51.2885-15\/e15\/10963933_639285076175423_883553371_n.jpg",
      "resource_url": null,
      "is_retweet": false,
      "network": {
        "id": 1,
        "brand_url": "https:\/\/instagram.com",
        "css_class": "instagram",
        "name": "Instagram"
      },
      "layout": {
        "id": 1,
        "name": "Full",
        "css": "layout-full"
      }
    },
    {
      "id": 35494590,
      "media_key": "896434644805837259_11285087",
      "feed_id": 135946,
      "from_user_name": "louboutinworld",
      "from_full_name": "Christian Louboutin",
      "network_id": 1,
      "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_11285087_75sq_1363347869.jpg",
      "media_type_id": 2,
      "perma_link": "something-beautiful-has-come-d",
      "source": "Instagram",
      "network_css": "instagram",
      "official_brand_url": "https:\/\/instagram.com",
      "votes": 60876,
      "image_width": 640,
      "image_height": 640,
      "status": 1,
      "providerName": null,
      "providerThumbUrl": null,
      "created_at": 1421083358,
      "title": "",
      "description": "Something beautiful has come! Discover it for yourself at ChristianLouboutin.com\/LouboutinWorld\n\n#LouboutinWorld",
      "target_url": "https:\/\/instagram.com\/p\/xwxo9YAWHL\/",
      "image_url": "https:\/\/scontent-b.cdninstagram.com\/hphotos-xaf1\/t51.2885-15\/e15\/10914310_372384636274248_1552995962_n.jpg",
      "resource_url": null,
      "is_retweet": false,
      "network": {
        "id": 1,
        "brand_url": "https:\/\/instagram.com",
        "css_class": "instagram",
        "name": "Instagram"
      },
      "layout": {
        "id": 1,
        "name": "Full",
        "css": "layout-full"
      }
    }
  ],
  "cached": "false",
  "offset": 0,
  "count": 20,
  "performance": 0.31
}

Post Body GET

The Post Body endpoint is used to retrieve the body for a given contentItem.

Usually most posts do not contain a body. Determine whether a post contains a body with the has_body flag on the contentItem

curl https://apps.twinesocial.com/api/v1/postBody?campaign=louboutin&id=120745121
$ch = curl_init("https://apps.twinesocial.com/api/v1/postBody?campaign=louboutin&id=120745121");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->body;
campaign
string (required) Example: louboutin

The name of the related Campaign.

id
string (required) Example: 2636367874

The id of the contentItem we are looking up.

{
  "success": true,
  "body": AN_HTML_BLOB
}

Follows GET

The follows endpoint is used to list official and featured social media accounts connected to a campaign. Use this endpoint to build dynamic toolbar or follow widgets into your website.

The follower counts for each social media connection are updated by the TwineSocial platform automatically 1x each day.

curl https://apps.twinesocial.com/api/v1/follows?campaign=louboutin
$ch = curl_init("https://apps.twinesocial.com/api/v1/follows?campaign=louboutin");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->name;
{
  "success": true,
  "follows": {
    "others": [
      {
        "id": 3398,
        "type": "others",
        "username": "Bloomingdales",
        "name": "Bloomingdale's",
        "likes": {
          "count": 291377,
          "subscriber_phrase": "Followers"
        },
        "subtitle": "Follow on Twitter",
        "profile_url": "https:\/\/pbs.twimg.com\/profile_images\/532595942705229824\/GLyuspYR_normal.jpeg",
        "objectId": "41338503",
        "network": {
          "id": 2,
          "brand_url": "https:\/\/twitter.com",
          "css_class": "twitter",
          "name": "Twitter"
        },
        "is_active": true
      },
      {
        "id": 3399,
        "type": "others",
        "username": "chanel",
        "name": "CHANEL",
        "likes": {
          "count": 364914,
          "subscriber_phrase": "Subscribers"
        },
        "subtitle": "Follow on YouTube",
        "profile_url": "https:\/\/yt3.ggpht.com\/-MtJ8vqJfYTo\/AAAAAAAAAAI\/AAAAAAAAAAA\/ftWEwKBTSZI\/s88-c-k-no\/photo.jpg",
        "objectId": "UCclHSnngVTZK7LEOQAzcg1w",
        "network": {
          "id": 3,
          "brand_url": "https:\/\/www.youtube.com",
          "css_class": "youtube",
          "name": "YouTube"
        },
        "is_active": true
      },
      {
        "id": 3400,
        "type": "others",
        "username": null,
        "name": "Nordstrom",
        "likes": {
          "count": 160762,
          "subscriber_phrase": "Followers"
        },
        "subtitle": "We're a fashion specialty retailer of clothing, shoes & accessories. Customer Service: 1-888-282-6060.",
        "profile_url": "https:\/\/lh3.googleusercontent.com\/-a-9TfmvLo88\/AAAAAAAAAAI\/AAAAAAAAAJU\/8w9xZggn4sE\/photo.jpg?sz=50",
        "objectId": "100708628843159305878",
        "network": {
          "id": 11,
          "brand_url": "https:\/\/google.com",
          "css_class": "google-plus",
          "name": "Google+"
        },
        "is_active": true
      },
      {
        "id": 3397,
        "type": "others",
        "username": "saks",
        "name": "Saks Fifth Avenue",
        "likes": {
          "count": null,
          "subscriber_phrase": "Followers"
        },
        "subtitle": "Follow on Instagram",
        "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_4886940_75sq_1375723398.jpg",
        "objectId": "4886940",
        "network": {
          "id": 1,
          "brand_url": "https:\/\/instagram.com",
          "css_class": "instagram",
          "name": "Instagram"
        },
        "is_active": true
      }
    ],
    "ours": [
      {
        "id": 23990,
        "type": "ours",
        "username": "Louboutin",
        "objectId": "14182564",
        "likes": {
          "count": 18540,
          "subscriber_phrase": "Followers"
        },
        "url": "https:\/\/www.twitter.com\/Louboutin",
        "profile_url": "https:\/\/pbs.twimg.com\/profile_images\/474725498\/ChristianLouboutin_normal.gif",
        "name": "Louboutin Fans",
        "network": {
          "id": 2,
          "brand_url": "https:\/\/twitter.com",
          "css_class": "twitter",
          "name": "Twitter"
        },
        "subtitle": null,
        "profileType": 1,
        "is_active": true
      },
      {
        "id": 23991,
        "type": "ours",
        "username": "Christian Louboutin",
        "objectId": "UCbwblpZeD3v63hacGIAKsqA",
        "likes": {
          "count": 1328,
          "subscriber_phrase": "Subscribers"
        },
        "url": "https:\/\/www.youtube.com\/user\/Christian Louboutin",
        "profile_url": "https:\/\/yt3.ggpht.com\/--e3f9EfFOk8\/AAAAAAAAAAI\/AAAAAAAAAAA\/xU6VcTIzEGM\/s88-c-k-no\/photo.jpg",
        "name": "Christian Louboutin",
        "network": {
          "id": 3,
          "brand_url": "https:\/\/www.youtube.com",
          "css_class": "youtube",
          "name": "YouTube"
        },
        "subtitle": null,
        "profileType": 1,
        "is_active": true
      },
      {
        "id": 20986,
        "type": "ours",
        "username": "christianlouboutinshoes",
        "objectId": "19191702",
        "likes": {
          "count": 43090,
          "subscriber_phrase": "Followers"
        },
        "url": "https:\/\/instagram.com\/christianlouboutinshoes",
        "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_19191702_75sq_1326342209.jpg",
        "name": "Christian Louboutin",
        "network": {
          "id": 1,
          "brand_url": "https:\/\/instagram.com",
          "css_class": "instagram",
          "name": "Instagram"
        },
        "subtitle": null,
        "profileType": 1,
        "is_active": true
      }
    ]
  },
  "count": 2,
  "cached": "true",
  "performance": 0.02
}

Promoted GET

The promoted endpoint is used to retrieve contentItems that are currently pinned or featured for a specified campaign. Learn how to pin & promote contentItems.

curl https://apps.twinesocial.com/api/v1/promoted?campaign=louboutin
$ch = curl_init("https://apps.twinesocial.com/api/v1/promoted?campaignwork=louboutin");
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
			$resp = curl_exec ($ch);
			$json = json_decode($resp);
			echo $json->name;

Groups  Requires Auth 

The groups endpoint is used to retrieve all or some Groups for a given account.

curl https://apps.twinesocial.com/api/v1/groups?groups=all&client_id=YOUR_CLIENT_ID&account_code=YOUR_ACCOUNT_CODE
$ch = curl_init("https://apps.twinesocial.com/api/v1/groups?groups=all&client_id=YOUR_CLIENT_ID&account_code=YOUR_ACCOUNT_CODE");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$resp = curl_exec ($ch);
$json = json_decode($resp);
echo $json->groups[0]->name;
account_code
string (required) Example: 13-4545BHC

The unique identifier for your account. You can find your account_code in the API section of your TwineSocial account admin. While logged into your account, simply navigate to the Account section on the left, then choose API.

groups
string (required) Example: all

Accepts either "all" (in which case all application groups are returned) or a comma delimited string of Group IDs.

{
	"success":true,
	"groups":[
		{
			"id":16432072593,
			"name":"Space Campaigns",
			"description":"Campaigns about space, air travel, and beyond.",
			"campaigns":[
				{
					"name":"NASA Page",
					"base_url":"nasa",
					"embed_script":"AN_EMBED_SCRIPT",
					"status":"Active",
					"statusId":1
				}
			]
		}
	]
}

Create Post  Requires Auth  POST

The createPost endpoint is used to dynamically create a non-social post for a campaign. Your POST request’s Content-Type should be set to multipart/form-data.

//set POST variables
$url = 'https://apps.twinesocial.com/api/v1/createPost';
$fields = array(
	'client_id' => "your_client_id",
	'field1' => value1,
	...
);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);
$url = 'https://apps.twinesocial.com/api/v1/createPost?campaign=louboutin';
$data = array('campaign' => 'N70P2DV8--', 'description' => 'Hello World', 'full_name' => "Noah J. Weaver", 'client_id'=> "add-your-client-id-here");

$params = http_build_query($data);

$url = stream_get_contents(fopen($url, "rb"));
campaign
string (required) Example: louboutin

The name of the campaign for which to create this post.

full_name
string (required) Example: John Doe

The first and last name of the post's author.

user_name
string (optional) Example: @JohnDoe

An optional internal username for the post's author.

description
string (optional) Example: "My new #TwineSocialPost!"

Description text associated with this post.

zip_code
integer (optional) Example: 34234

The zip code of the posts's author.

email
integer (optional) Example: steve@apple.com

The posts author's email address.

tc_approve
integer (optional) Default: 0 Example: 1

Register whether or not the post author has agreed to your terms and conditions.

status
string (optional) Default: modpending Example: modpending

Optionally, publish the newly authored post immediately. Or send it to moderation for approval.

active
Publish item immediately.
modpending
Send item to moderation status.
shared_url
string (optional) Example: date-asc

Optionally include a public url to relate to the authored post. The url will be scraped for content to returned as a related post to the author's original post.

post_image_url
string (optional) Example: https://youwebsite.com/hero_image.png

Set a hero image for your post. The post_image parameter accepts image url.

profile_image_url
string (optional) Example: https://yourwebsite.com/profile_image.png

Set a profile image for your post's author. The post_image parameter accepts image url.

video_url
string (optional) Example: https://www.youtube.com/embed/57dzaMaouXA

Optionally included a valid url to an hosted video.

collections
array (optional) Example: 6457

Include an array of ids for collections to associate with this post.

{
  "success": true,
  "message":"Your post was successfully created."
  "item":
    {
      "id": 37447240,
      "media_key": "910956065087120103_11285087",
      "feed_id": 135946,
      "from_user_name": "louboutinworld",
      "from_full_name": "Christian Louboutin",
      "network_id": 1,
      "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_11285087_75sq_1363347869.jpg",
      "media_type_id": 2,
      "perma_link": "a-louboutin-woman-has-style-be",
      "source": "Twine",
      "network_css": "Twine",
      "votes": 53198,
      "image_width": 640,
      "image_height": 640,
      "status": 1,
      "providerName": null,
      "providerThumbUrl": null,
      "created_at": 1422814447,
      "title": "",
      "description": "A Louboutin woman has style, beauty... and balance.",
      "target_url": "https:\/\/instagram.com\/p\/ykXbb5gWLn\/",
      "image_url": "https:\/\/scontent-b.cdninstagram.com\/hphotos-xaf1\/t51.2885-15\/e15\/10948756_1545595462379676_1727815357_n.jpg",
      "resource_url": null,
      "is_retweet": false,
      "layout": {
        "id": 1,
        "name": "Full",
        "css": "layout-full"
      }
    }
}

Post Vote  Requires Auth  POST

The postVote endpoint is used to vote on content for a campaign. Your POST request’s Content-Type should be set to multipart/form-data.

//set POST variables
$url = 'https://apps.twinesocial.com/api/v1/postVote';
$fields = array(
	'client_id' => "your_client_id",
	'field1' => value1,
	...
);

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);
$url = 'https://apps.twinesocial.com/api/v1/postVote?campaign=louboutin';
$data = array('campaign' => 'N70P2DV8', 'id' => '12124');

$params = http_build_query($data);

$url = stream_get_contents(fopen($url, "rb"));
campaign
string (required) Example: louboutin

The name campaign of the campaign for which to create this post.

id
integer (required) Example: 435465

The global id of the post you are voting on.

{
  "success": true,
  "message":"Vote was processed.",
  "total_votes":34
}

Object Reference

The following objects are used in the REST API. All objects are in the JSON format.


campaignItem

The campaignItem object represents an individual campaign from your account.

{
"campaign": {
	"name":"NASA Page",
	"base_url":"nasa",
	"embed_script":"AN_EMBED_SCRIPT",
	"status":"Active",
	"statusId":1
	}
}
name
string (optional) Example: World Class Driving

The name of the campaign.

status
string (required) Example: Active

A text description of the status of this campaign.

statusId
number (required) Example: 1

A numeric description of the status of this campaign.

Additional fields may appear a campaignItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.


contentItem

The contentItem object represents an individual content item from your campaign, such as a Facebook Page post, a Tweet, or an Instagram post.

{
	"id": 31098100,
	"media_key": "873903219015770454_11285087",
	"feed_id": 78651,
	"from_user_name": "louboutinworld",
	"from_full_name": "Christian Louboutin",
	"profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_11285087_75sq_1363347869.jpg",
	"media_type_id": 2,
	"perma_link": "pwe-marked-the-first-year-of-o",
	"source": "Instagram",
	"votes": 31477,
	"status": 1,
	"created_at": 1418397360,
	"title": "",
	"description": "We marked the first year of our Aoyama Boutique in Japan with a pair of exclusive new shoes!",
	"target_url": "https:\/\/instagram.com\/p\/wgulj5gWFW\/",
	"image_url": "https:\/\/scontent-b.cdninstagram.com\/hphotos-xaf1\/t51.2885-15\/10817899_671484659636631_695742053_n.jpg",
	"image_height":800,
	"image_width":800,
	"resource_url": "",
	"is_retweet": false,
	"network": {
	  "id": 1,
	  "brand_url": "https:\/\/instagram.com",
	  "css_class": "instagram",
	  "name": "Instagram"
	},
	"layout": {
	  "id": 1,
	  "name": "Full",
	  "css": "layout-full"
	},
	"has_body": false,
	"cta":{
		"cta_id":430,
		"name":"Hat",
		"button_text":"Buy the Hat!",
		"target_url":"http://amazon.com/hat",
		"has_detail":true,
		"detail":{
			"image_url":"//static.twinesocial.com/uploads/jasonbourne/27149cd50d30a07bd0d329f73012c4e78ec99053.png",
			"description_text":"

Lorem ipsum dolor sit amet Noah, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim venia m, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute i" } } }

id
number (required)

The globally unique numeric identifier for this content item in the TwineSocial data store.

media_key
string (required)

The globally unique string identifier for this content item (usually the original Tweet ID or Facebook Post ID). Used to correlate a post with third-party tools.

from_user_name
string (optional) Example: twinesocial

The content author's username. It is not preceded by the @ symbol.

from_full_name
string (optional) Example: Mark Hanson

The content author's full name, if known.

network_id
number (required) Example: 1

A numeric identifier corresponding to where this content was discovered.

profile_url
string (optional)

The author's avatar image.

source
string (required) Example: Instagram

The name of the community or network where this content originated from.

votes
number (required) Example: 25

The sum of the number of votes/likes this content acquired at the time it was ingested.

created_at
timestamp (required) Example: 1417844936

The epoch timestamp for when this content was authored.

title
string (optional) Example: She's Just Our Type!

Content title

description
string (optional) Example: We have no more to say.

Content description

target_url
string (optional) Example: https://instagram.com/p/wQQ1wrsvSR/

A URL corresponding to the original source location

image_url
string (optional) Example: https://www.msnbc.com/image.jpg

A URL for the primary photo for this contentItem

image_width
number (optional) Example: 640

The width in pixels of the primary photo for this contentItem.

image_height
number (optional) Example: 480

The width in pixels of the primary photo for this contentItem.

resource_url
string (optional)

A URL pointing to the video stream

is_retweet
boolean (optional) Default: false Example: false

Indicates if this item is a retweeted.

layout
layout (required)

Populated with layout details for this contentItem

network
networkItem (required)

Populated with a networkItem object for this contentItem.

has_body
boolean (required) Default: false Example: false

Indicates whether this item has a Post Body. You must access the Post Body separatley through the Post Body endpoint.

cta
ctaItem (optional)

Populated with Call To Action details for this contentItem.

related
contentItem (optional)

Populated if this contentItem is in reference to a related contentItem. For example, if you comment on a Facebook post, your comment will appear as a contentItem; the original Facebook post will appear as a related contentItem.

Additional fields may appear in a contentItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.


followerItem

The followerItem object represents Follower properties for a campaign.

{
  "id": 2941,
  "type": "others",
  "username": "christianlouboutinshoes",
  "name": "Christian Louboutin",
  "cssclass": "instagram",
  "subtitle": "Follow on Instagram",
  "profile_url": "https:\/\/instagramimages-a.akamaihd.net\/profiles\/profile_19191702_75sq_1326342209.jpg",
  "objectId": "19191702",
  "network": {
    "id": 5,
    "brand_url": "https:\/\/www.instagram.com",
    "css_class": "Instagram"
  },
  "likes": {
    "count": 123254,
    "subscriber_phrase": "followers"
  },
  "is_active": true
}
id
id (required)

The globally unique numeric identifier for this followerItem.

type
string (required) Example: others

Indicates whether this item represents an official brand account (ours) or a followed/promoted account (others).

username
string (required) Example: louboutin

The network-specific username for this item. For example, if the Twitter account name is @twinesocial, you'll see twinesocial in this field.

network
networkItem (required)

Contains network-specific properties for this follower.

likes.count
number (required)

The number of likes/followers that this account has. This value is updated daily by the TwineSocial platform.

likes.subscriber_phrase
string (required) Example: fans

The unit of measure for likes.count.

subtitle
string (required)

A text subtitle

profile_url
string (required)

The follower's avatar image.

objectId
number (optional)

The network-specific ID for this follower. Typically corresponds to their Facebook,Twitter, Instagram, or other social network userID.

is_active
boolean (required) Example: true

Indicates if this follower profile is active or not. Monitor this field to detect OAUTH token failures.

Additional fields may appear in a followerItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.


networkItem

The networkItem object describes a social media network.

{
  "network": {
    "id": 1,
    "brand_url": "https:\/\/instagram.com",
    "css_class": "instagram",
    "name": "Instagram"
  }
}
id
id (required) Example: 3

The unique numeric identifier for this social media network.

brand_url
string (required) Example: https://instagram.com

The official homepage for the social media network

css_class
string (required) Example: instagram

A css_class name which uniquely identifies this network. Used when building UI components. This text string will always correspond with a brand icon available in the Font Awesome library.

name
string (required) Example: Instagram

A string which uniquely identifies this network.

Additional fields may appear in a networkItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.


ctaItem

The ctaItem object represents Call To Action properties for a content item. Use the Rules Engine to automatically add CTAs to contentItems, or manually add CTAs to contentItems using the Admin Console.

{
	"cta_id":430,
	"name":"Hat",
	"button_text":"Buy the Hat!",
	"target_url":"http://amazon.com/hat",
	"fa_icon":"map-marker",
	"icon_size":2,
	"icon_shape":"circle",
	"has_detail":true,
	"detail":{
		"image_url":"//static.twinesocial.com/uploads/jasonbourne/27149cd50d30a07bd0d329f73012c4e78ec99053.png",
		"description_text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolo.",
	}
}
cta_id
number (required)

The globally unique numeric identifier for this CTA Type.

button_text
string (required) Example: Buy Now

The text to display for this Call To Action.

target_url
string (required) Example: https://www.amazon.com/buynow

The URL to direct to when this CTA is engaged.

has_detail
boolean (required) Example: false

Indicates whether CTA includes a extended details object.

fa_icon
string (required) Default: "map-marker"

The Font Awesome 4.7 icon name for CTA hotspot marker.

icon_size
number (required) Default: 2

The size of the hotspot marker (can be 1, 2, or 3).

icon_shape
number (required) Default: "circle"

The shape of the background icon over which the hotspot marker is placed.

detail
object (optional) Example (see above)

The detail object contains: decription_text, a block any additional information about the CTA, and image_url, a url to an image for the CTA.

Additional fields may appear in a ctaItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.


authorItem

The authorItem object represents author information associated with a non-social post. Non-social posts can be created via the createPost endpoint.

{
"id":65,
"created_at":"1942-12-7 10:42:23",
"full_name":"John Doe",
"email":john@johndoe.com,
"zip":45385,
"tc_approve":true
}
id
id (required)

The globally unique numeric identifier for this authorItem.

created_at
string (required) Example: 1417844936

The epoch timestamp for when this author was created.

full_name
string (optional)

The author's full name, if known.

zip
string (optional)

The author's zip code, if known.

tc_approve
boolean Default: false (optional)

Indicates if the author has agreed to the terms and conditions.

Additional fields may appear in a authorItem. However, developers should not rely on them; use them at your own risk. They may be dropped at any time without prior notice, or a version change to the API.