API Support

API support is available for posting messages to Twitter using Twextra's RESTful API. Please fill out the following form to get your Twextra key.

          Email:

 First Name:

 Last Name:

 Application:

   Company:

    Web-Site:

                                      

Overview

The Twextra Twitter API lets you post large messages (upto 100,000 characters) to Twitter. It is used with normal HTTP POST requests. The API uses Twitter's OAuth method to authenticate the identity of a Twitter user.

Method: upload

URL: http://twextra.com/router.php

Fields

       route
       social
       editor
       twextra_key
       twitter_access_token
       twitter_access_token_secret

Sample curl command

curl  http://twextra.com/router.php  
-X POST 
-d route="tweet_post" 
-d social="twitter"
-d editor="your message to be posted" 
-d twextra_key="your twextra key" 
-d twitter_access_token="your twitter access token"  
-d twitter_access_token_secret="your twitter access token secret"  

Format: json

Sample json response

{
	"place":null,
	"in_reply_to_screen_name":null,
	"retweeted":false,
	"coordinates":null,
	"geo":null,
	"source":"http://twextra.com",
	"retweet_count":null,
	"favorited":false,
	"in_reply_to_status_id":null,
	"created_at":"Mon Oct 18 06:39:31 +0000 2010",
	"in_reply_to_user_id":null,
	"user":{
		"listed_count":0,
		"verified":false,
		"description":null,
		"follow_request_sent":false,
		"profile_sidebar_fill_color":"DDEEF6",
		"time_zone":"Pacific Time (US & Canada)",
		"profile_sidebar_border_color":"C0DEED",
		"followers_count":0,"url":null,
		"show_all_inline_media":false,
		"notifications":false,
		"profile_use_background_image":true,
		"friends_count":4,
		"lang":"en",
		"statuses_count":871,
		"created_at":"Tue Aug 10 06:24:42 +0000 2010",
		"profile_background_color":"C0DEED",
		"profile_image_url":"http://s.twimg.com/a/1287010001/images/default_profile_5_normal.png",
		"location":null,
		"profile_background_image_url":"http://s.twimg.com/a/1287010001/images/themes/theme1/bg.png",
		"favourites_count":1,"protected":true,"contributors_enabled":false,
		"profile_text_color":"333333",
		"screen_name":"your screen name",
		"name":"your name",
		"following":false,
		"geo_enabled":false,
		"profile_background_tile":false,
		"id":nnnnnnnnn,"utc_offset":-28800,
		"profile_link_color":"0084B4"
	},
			
	"contributors":null,
	"id":nnnnnnnnnnn,
	"truncated":false,
	"text":"your message prefix... http://twextra.com/5252h3",
	"success":"Your message was posted successfully."
}

Sample PHP code snippet

...


$message="Hello World!";

$post_data = array(
               "route" => "tweet_post",
               "social" => "twitter",
               "editor" => $message,
               "twextra_key" => "your twextra key",
               "twitter_access_token" => "your twitter access token",
               "twitter_access_token_secret" => "your twitter access token secret"
       );

$ch = curl_init();
$request = "http://twextra.com/router.php";
curl_setopt ( $ch, CURLOPT_URL, $request );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

// This returns json encoded result
$result = curl_exec($ch);
$result_json = json_decode($result);
var_dump($result_json); // Debug purposes

curl_close($ch);