Crum.bs API is here!!!
- Which API is best for you?
- Advanced Shorten
First of all, we’d like to thank you for your interest in crum.bs! Crum.bs is a url shortening service with a very simple API. All will be explained in this documentation, which will explore the options available, help you decide which is right for you, and give examples as to how to actually develop with crum.bs in mind.
Good luck, and thanks again. If you have any questions, do not hesitate to contact us via twitter. @Crum_bs
Which API is best for you?
Which API is best for you is a matter of what options you want your users to have when shortening their urls, and whether you are prepared to use a more complicated request for data, as well as a more complicated parsing of a response.
Below are a list of questions you should ask yourself to help decide which is better to use:
- Are you prepared to…
- submit form data?
- parse JSON?
- Would your users benefit from…
- url limits and password protection?
- being able to edit the description?
- Do the features of the advanced API outweigh the potential extra code/libraries/complexity of it, when compared with simpleshorten?
“Simpleshorten” is a very simple and easy way to generate shortened links. To use “Simpleshorten”, simply use the following API syntax:
http://crum.bs/api.php?function=simpleshorten&url=[insert url here]
An example response:
One of the major drawbacks with simpleshorten is the lack of errors. If there is an error, simpleshorten will send an empty response. Errors include malformed urls and no url. On the other hand, simpleshorten is incredibly easy to build into your application. Because there is no JSON surrounding the url, or any extra information, it greatly simplifies the process of getting the url back into your app.
Please note: The user must be aware that by using the shortening service through your app, they are agreeing to the Terms and Conditions.
Advanced Shorten gives the developer powerful features for his application’s shortened links. All the options available on the crum.bs website are also offered on the API. This means an app can take advantage of password protecting links, limiting the amount of visits to a link, and editing the description of the link its self.
Advanced Shorten uses POST requests to send data. The reason for this is because it is standard practice for APIs to use POST when submitting data, and GET when requesting data. Simpleshorten flouts this rule for the sake of simplicity and for those whom are affected by cross domain request restrictions.
Example POST variables:
url = "http://www.johnhamelink.com/" desc = "Johnhamelink.com is a web development blog." custom = "jhamelink" password = "fdlk45nb05f" limit = 200 terms = 1
An example response with the above variables: