Sunteți pe pagina 1din 4

December 7, 2010

Benoit

Joliprint REST API Documentation


Joliprint REST API Documentation
The Joliprint API allows third-party applications to turn URLs into Joliprint PDF. rejected. All spaces should be either percent encoded (%20) or plus encoded (+). Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening. Examples You want to convert the URL http://bit.ly/fFZ8u0 to a PDF: http://api.joliprint.com/api/rest/url/print/s/ foo?url=http://bit.ly/fFZ8u0

Getting Started Request Structure


the Joliprint REST API requests can be divided in 4 parts: 1. Server (required) : http://api.joliprint.com 2. Common path (required) : /api/rest/url 3. Method (required) : print, xml, json, jpg, text 4. App Settings (recommended) : /s/foo Note : foo is a name of your application. This parameter is important for further analytics reports and it is also important that you choose a name according to the name of your application but please do not use foo.

App Settings
The App Settings parameter is optional. An application can send both anonymous and / or signed requests to Joliprint. We recommend to add the App name parameter in the requests so Joliprint can provide accurate analytics reports.

REST API
No user key or authentication are required to use the API. The only thing you need is : 1. Choose a server based on your server location. 2. Call a method (print, xml, json, jpg, text) 3. Feed the method with a URL

Notes
URLs should be URL-encoded. You cant include a url in the request with &, ?, #, , or other reserved parameters without encoding it. Avoid spaces: any url with spaces will be

http://joliprint.com/api/

/url/print
/url/print turns a URL into a PDF document.

Love this

PDF?

Add it to your Reading List! 4 joliprint.com/mag


Page 1

December 7, 2010

Joliprint REST API Documentation

Parameter
url (required): the URL to turn into PDF.

Output Example
Url to convert: http://lifehacker. com/5706937/dont-make-important-decisions-until-your-decision-time Url to convert (encoded): http%3A%2F%2Flifehacker.com%2F5 706937%2Fdont%2Dmake%2Dimportant% 2Ddecisions%2Duntil%2Dyour%2Ddecision %2Dtime Get the PDF from the API: http://api. joliprint.com/api/rest/url/print/s/ foo?url=http%3A%2F%2Flifehacker.com%2 F5706937%2Fdont%2Dmake%2Dimportant %2Ddecisions%2Duntil%2Dyour%2Ddecisi on%2Dtime

size: PDF size in bytes. lastmodified: last modification date in milliseconds. url: PDF long url. shorturl: PDF short url. preview: PDF thumbnail (JPG).

Example
Get the XML informations: http://api.joliprint.com/api/rest/url/xml/s/ foo?url=http%3A%2F%2Flifehacker.co m%2F5706937%2Fdont%2Dmake%2D important%2Ddecisions%2Duntil%2D your%2Ddecision%2Dtime <?xml version=1.0 encoding=UTF-8?> <response> <status_code>200</status_code> <status_text>OK</status_text> <data> <title>Dont Make Important Decisions Until Your Decision Time</title> <filename>lifehacker.com-don-t-make-important-decisions-until-your-decision-time-. pdf</filename> <size>267384</size> <lastmodified>1291750695000</lastmodified> <url>http://api.joliprint.com/api/rest/url/ print?url=http%3A%2F%2Flifehacker. com%2F5706937%2Fdont-make-importantdecisions-until-your-decision-time</url> <shorturl>http://prin.tt/hnT5RN</shorturl> <preview>http://api.joliprint.com/api/rest/ url/jpg?url=http%3A%2F%2Flifehacker. com%2F5706937%2Fdont-make-importantdecisions-until-your-decision-time</preview> </data> </response>

/url/xml
/url/xml returns a structured XML document that describes the PDF attributes.

Parameter
url (required): the URL to turn into PDF.

Output
status_code: indicates wether the request succeeded or failed: 200 : Success. Everything is right 500 : Fail. An error occured status_text: the status_code label: 200 : OK 500 : the error message title: webpage title filename: PDF file name

/url/json
/url/json returns a structured JSON document that describes the PDF.

http://joliprint.com/api/

Parameter
url (required): the URL to turn into PDF.

Love this

PDF?

Add it to your Reading List! 4 joliprint.com/mag


Page 2

December 7, 2010

Joliprint REST API Documentation

Output
status_code: indicates wether the request succeeded or failed: 200 : Success. Everything is right 500 : Fail. An error occured status_text: the status_code label: 200 : OK 500 : the error message title: webpage title filename: PDF file name size: PDF size in bytes. lastmodified: last modification date in milliseconds. url: PDF long url. shorturl: PDF short url. preview: PDF thumbnail (JPG).

/url/jpg
/url/jpg returns a JPEG image (thumbnail) of the PDFs firt page.

Parameter
url (required): the URL to turn into PDF.

Output Example
Url to convert: http://lifehacker. com/5706937/dont-make-important-decisions-until-your-decision-time Url to convert (encoded): http%3A%2F%2Flifehacker.com%2F57069 37%2Fdont%2Dmake%2Dimportant%2Dde cisions%2Duntil%2Dyour%2Ddecision%2D time Get the thumbnail from the API: http:// api.joliprint.com/api/rest/url/jpg/s/ foo?url=http%3A%2F%2Flifehacker.com%2 F5706937%2Fdont%2Dmake%2Dimportant %2Ddecisions%2Duntil%2Dyour%2Ddecisi on%2Dtime

Example
Get the JSON informations: http:// api.joliprint.com/api/rest/url/json/s/ foo?url=http%3A%2F%2Flifehacker.com% 2F5706937%2Fdont%2Dmake%2Dimporta nt%2Ddecisions%2Duntil%2Dyour%2Ddec ision%2Dtime { status_code:200, status_txt:OK, data: { shorturl:http:// prin.tt/hnT5RN, title:Dont Make Important Decisions Until Your \Decision Time\, preview:http://api.joliprint.com/api/rest/ url/jpg?url=http%3A%2F%2Flifehacker. com%2F5706937%2Fdont-make-important-decisions-until-your-decisiontime, lastmodified:1291750695000, filename:lifehacker.com-don-t-make-important-decisions-until-your-decision-time-. pdf, url:http://api.joliprint.com/api/ rest/url/print?url=http%3A%2F%2Flifehac ker.com%2F5706937%2Fdont-make-important-decisions-until-your-decision-time, size:267384 } }

/url/text/
/url/text/ returns the PDF shorten URL.

Parameter
url (required): the URL to turn into PDF.

Output Example
Url to convert : http://lifehacker. com/5706937/dont-make-important-decisions-until-your-decision-time

http://joliprint.com/api/

Love this

PDF?

Add it to your Reading List! 4 joliprint.com/mag


Page 3

December 7, 2010

Joliprint REST API Documentation

Url to convert (encoded): http%3A%2F%2Flifehacker.com%2F57069 37%2Fdont%2Dmake%2Dimportant%2Dde cisions%2Duntil%2Dyour%2Ddecision%2D time Get the short URL from the API: http:// api.joliprint.com/api/rest/url/text/s/ foo?url=http%3A%2F%2Flifehacker.com%2 F5706937%2Fdont%2Dmake%2Dimportant %2Ddecisions%2Duntil%2Dyour%2Ddecisi on%2Dtime

http://joliprint.com/api/

Love this

PDF?

Add it to your Reading List! 4 joliprint.com/mag


Page 4

S-ar putea să vă placă și