API Documentation

Use our API to connect your Application to img.ly
The following methods to allow you to get connect with img.ly:

http://img.ly/api/uploadAndPost

This method uploads an image to img.ly and posts it as a status update on Twitter

Pass following parameters, formatted as multipart/form-data:

  • media (required): Binary image data
  • username (required): Twitter username
  • password (required): Twitter password
  • message (optional): Message to post to twitter. The URL of the image is automatically added

Returns:

<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
<statusid>1111</statusid>
<userid>11111</userid>
<mediaid>test123</mediaid>
<mediaurl>http://img.ly/abc123</mediaurl>
</rsp>

http://img.ly/api/upload

This method uploads an image to img.ly. No status update on Twitter.

Pass following parameters, formatted as multipart/form-data:

  • media (required): Binary image data
  • username (required): Twitter username
  • password (required): Twitter password

Returns:

<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
<mediaid>test123</mediaid>
<mediaurl>http://img.ly/abc123</mediaurl>
</rsp>

Error Response

Sample Response:

<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="fail">
<err code="1001" msg="Invalid twitter username or password" />
</rsp>

Error Codes:

  • 1001: Invalid twitter username or password
  • 1002: Image not found
  • 1003: Invalid image type
  • 1004: Image larger than 4MB

Image Thumbs

Format: http://img.ly/show/[mini|thumb|medium|large|full]/<image-id>

Example for a thumb URL: http://img.ly/show/thumb/3de

Even smaller thumb: http://img.ly/show/mini/3de

These URLs will redirect to the actual locations of the images

If you use those thumbnails, please link them to the corresponding image URL like

<a href="http://img.ly/3de">
<img src="http://img.ly/show/thumb/3de">
</a>

Append your application name to the updates sent from your API application!

If we should send your sourcekey instead of ours just send us (imgly@9elements.com) your sourcekey and a header which we can use to identify your app as a client and we'll make it work asap.

Questions? imgly _at_ 9elements.com