Blog


SENDtoREADER API

July 4th, 2011

In short, our API allows third party applications to send web pages to their users’ Kindles just like Sendtoreader.com does.

There are only 2 API methods currently available, and both of them are accessible via very simple HTTP or HTTPS calls. 

To test any of those methods simply enter the appropriate URL with necessary parameters in your browser’s address bar, and you’ll get a simple text response. Actually, the HTTP status code will contain all information you need to know, but if your application can’t read the status code from the header, you can read the status code from the response body.

For easy integration into 3rd-party applications, all parameters may be passed via POST or the query string (GET) or any mixed combination.

The API is available via HTTP or HTTPS. I’d suggest to use HTTPS when possible.

User authentication

This method does a very simple job: it checks the given pair of username and password for validity. Use this if you want to only check credentials without sending anything to Sendtoreader, such as when you first prompt the user for Sendtoreader credentials in a settings screen or on the first Sendtoreader request.

URL: https://sendtoreader.com/api/checklogin/

Parameters:

  • username
  • password

Sample call:

https://sendtoreader.com/api/checklogin/?username=someusername&password=secret

Resulting status codes:

  • 200: OK
  • 401: Exceeded the rate limit. Please wait 10 seconds and try again.
  • 403: Invalid username or password.
  • 500: The service encountered an error. Please try again later.

Sending web pages to Sendtoreader for processing

URL: https://sendtoreader.com/api/send/

Parameters:

username (required)
password (required)
title
author
url 
text (either url or text is required)

Sample call:

https://sendtoreader.com/api/send/?username=xxx&password=yyy&url=http://someurl.com/page.html

Please don’t forget to encode the parameters (urlencode). If you are having troubles with user login or sending a web page to his Kindle through Sendtoreader, this is very likely to be the issue. If you are using GET requests or producing POST request-body manually, you need to URL-encode the values.

Resulting status codes:

  • 200: The page has been successfully sent to user’s Kindle or saved on his/her account.
  • 401: Exceeded the rate limit. Please wait 10 seconds and try again.
  • 403: Invalid username or password.
  • 405: Error: Sendtoreader is not able to process this URL.
  • 406: Error: Specified URL is not corrrect.
  • 424: Internal Sendtoreader error. Please contact support for investigation.
  • 427: Sendtoreader can’t send document to the user. Maybe wrong or no kindle email in this user’s settings.
  • 500: The service encountered an error. Please try again later.

Additional information

  • Encoding
    All requests must be UTF-8. 
  • Rate limit
    In order to make the Sendtoreader API work smoothly, rate limiting rules apply. If you make too many requests too fast, you’ll start getting 401 Error responses. When rate limiting has kicked in, you’ll have to wait 10 seconds before making more requests.
  • Support and Feedback
    If you have any question about the API, or have found a bug, or need additional functionality, please email me at sergey@sendtoreader.com. I’ll try to help.
Found this article interesting / helpful? Share it with your friends

Read also:

Tagged


Comments

  1. Jonas
    • Sergey
    • Sergey
  2. noname128
  3. Kris
    • Sergey

Leave a Reply

Leave Feedback