Adf.ly
provides you with a simple, yet useful API for your application. Simply
have your application access a URL like the following example:
Replace "http://somewebsite.com" with whatever URL you are wanting shortened. The "key" and "uid" fields must be as they are above or the request will return an error.
Replace "advert_type=int" with "advert_type=banner" if you require the Framed Banner advertising option.
Replace "domain=adf.ly" with "domain=q.gs" if you wish to use our q.gs domain.
Replace "domain=adf.ly" with "domain=xxxx.xxx" if you wish to use your custom domain.
The shortened URL will be returned to you in the body of the response in plain text. If the request was unsuccessful for any reason you will receive "error" as your response. If the exact link you request is already in your account, the original shortened URL will be returned to you and no new entry added to your account.
There will most likely be special characters in the URL you send, so you must encode the URL with Javascript's encodeURIComponent() or its equivalent in other languages, otherwise your request will fail.
http://api.adf.ly/api.php?key=8f9f2f99dbe2699117b2f7cb9758d68b&uid=2063730&advert_type=int&domain=adf.ly&url=http://somewebsite.com
Replace "http://somewebsite.com" with whatever URL you are wanting shortened. The "key" and "uid" fields must be as they are above or the request will return an error.
Replace "advert_type=int" with "advert_type=banner" if you require the Framed Banner advertising option.
Replace "domain=adf.ly" with "domain=q.gs" if you wish to use our q.gs domain.
Replace "domain=adf.ly" with "domain=xxxx.xxx" if you wish to use your custom domain.
The shortened URL will be returned to you in the body of the response in plain text. If the request was unsuccessful for any reason you will receive "error" as your response. If the exact link you request is already in your account, the original shortened URL will be returned to you and no new entry added to your account.
There will most likely be special characters in the URL you send, so you must encode the URL with Javascript's encodeURIComponent() or its equivalent in other languages, otherwise your request will fail.
No comments:
Post a Comment