Twipl Open API

Twipl Open API

1. API v2 » upload (POST w/ OAuth Echo)

Use this method to upload an image to twipl. (Not to twitter, be Careful.)
(http://api.twipl.net/2/upload.format)

URL

http://api.twipl.net/2/upload.format

Available Formats

xml, json

HTTP Method

POST

Header

X-OAUTH-AUTHORIZATION (Required)

Header Example

1 OAuth realm="http://api.twitter.com/",
2 oauth_consumer_key="HRfdwQH6hermWEgph32e",
3 oauth_signature_method="HMAC-SHA1",
4 oauth_token="107297-Jtn8aEFTUmykzVKdbdwhXSq67Tea8fce4GJC2rHjyr",
5 oauth_timestamp="2872358650",
6 oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y",
7 oauth_version="1.0",
8 oauth_signature="J9py8iKhe19J1kaGEdfTyqJdspo%3D"

X-OAUTH-SP-URL (Required)
https://api.twitter.com/1/account/verify_credentials.xml

Parameters

Fields to post in
(post data should be formatted as multipart/form-data)

Parameter Description
key Your Twipl API Key (required)
message Message (optional)
Message to post to twitter
media1~20 The file to upload(required) , Binary image data
ip IP Address (optional)
source Uploader’s name (optional), service, applications or person's name
lat Latitude(optional), Location Tag (You must enter your latitude and longitude.)
long Longitude(optional), Location Tag (You must enter your latitude and longitude.)
Message add to 23 characters as twipl URL.
If message exceeds 116 characters, will be ignored and the remaining 116 characters are sent.

Example Response

When an upload is successful, following xml is returned.

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<mediaid>abc123456</mediaid>
<mediaurl>http://twipl.net/abc123456</mediaurl>
</response>

Error Code

See error codes.

2. API v1 » uploadAndPost (POST w/ )

Use this method to upload an image to twipl and to send it as a status update to twitter
http://api.twipl.net/uploadAndPost.format

URL

http://api.twipl.net/1/uploadAndPost.format

Available Formats

xml, json

HTTP Method

POST

Parameters

Fields to post in
(post data should be formatted as multipart/form-data)

Parameter Description
key Your Twipl API Key (required)
oauth_token The Twitter OAuth token for the user (required)
oauth_secret The Twitter OAuth secret for the user (required)
message Message (optional or required)
Message posting to twitter
(If no media attached, message parameter to be required)
media1~20 The file to upload(required) , Binary image data
ip IP Address (optional)
source Uploader’s name (optional), service, applications or person's name
lat Latitude(optional), Location Tag (You must enter your latitude and longitude.)
long Longitude(optional), Location Tag (You must enter your latitude and longitude.)
Message add to 23 characters as twipl URL.
If message exceeds 116 characters, will be ignored and the remaining 116 characters are sent.

Example Response

When an uppload and posting is successful, following xml is returned.
(file attached, posting to twipl and twitter)

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<statusid>12345678</statusid>
<userid>12345678</userid>
<mediaid>abc123</mediaid>
<mediaurl>http://twipl.net/abc123</mediaurl>
</response>
‘mediaid’ is posting ID



When an posting is successful, the following xml is returned:
(message only. No files attached, Posting to twitter)

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<statusid>12345678</statusid>
<userid>12345678</userid>
</response>

Error Code

See error codes.

3. API v1 » upload (POST w/ )

Use this method to upload an image to twipl. (Not to twitter, be Careful.)
(http://api.twipl.net/1/upload.format)

URL

http://api.twipl.net/1/upload.format

Available Formats

xml, json

HTTP Method

POST

Parameters

Fields to post in
(post data should be formatted as multipart/form-data)

Parameter Description
key Your Twipl API Key (required)
oauth_token The Twitter OAuth token for the user (required)
oauth_secret The Twitter OAuth secret for the user (required)
message Message (optional)
Message to post to twitter
media1~20 The file to upload(required) , Binary image data
ip IP Address (optional)
source Uploader’s name (optional), service, applications or person's name
lat Latitude(optional), Location Tag (You must enter your latitude and longitude.)
long Longitude(optional), Location Tag (You must enter your latitude and longitude.)
Message add to 23 characters as twipl URL.
If message exceeds 116 characters, will be ignored and the remaining 116 characters are sent.

Example Response

When an upload is successful, following xml is returned.

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<mediaid>abc123456</mediaid>
<mediaurl>http://twipl.net/abc123456</mediaurl>
</response>

Error Code

See error codes.

4. Image Thumbnails

Use the following URL structure to use Twipl thumbnails.

http://api.twipl.net/show/<size>/<image-id>

<size> : : mini, thumb, view, large (select size)
<image-id> : this is the ID of the Twipl photo

Example codes

api.twipl.net/show/mini/aa(You can get 68x68px thumbnail image.)
api.twipl.net/show/thumb/aa(You can get 128x128px thumbnail image.)
api.twipl.net/show/view/aa(You can get maximum 500px widths image.)
api.twipl.net/show/large/aa(You can get maximum 1280px widths image.)

* Note : if you use a Twipl thumbnail, the photo must link back to its original photo page or a link
to the original photo page must be provided somewhere within context to the thumbnail

5. Error Code

If upload fails, the following error codes are returned.
Error Code Description
400 Bad Request if one of the required parameters is missing.
401 Authentication credentials were missing or incorrect.
502 Twitter is down or being upgraded.
1002 Image not found
No photo specified. The media required parameter was missing.
1003 Message not found
1004 Invalid image type (jpg, gif, png formats are upload able.)
1005 User exceeded upload limit. Image larger than 5MB
1006 User exceeded upload limit. Image more than 20 files.
1007 General upload failure
1008 IP address notation is frustrating.(ex. 255.255.255.255)
1009 Location Tag error
Latitude and longitude notation is frustrating.
The latitude whose valid range is -90 to 90.
The longitude whose valid range is -180 to 180
1012 Invalid Twipl API Key
1013 Missing Consumer Key or Consumer Secret

Example Response

When an uppload and posting is fail, following xml is returned.

<?xml version="1.0" encoding="UTF-8"?>
<response status="fail">
<code>401</code>
<description><![CDATA[ Authentication credentials were missing or incorrect ]]></description>
</response>