dlvr.it API Specification
Using the API
- Currently 'xml' (default) and 'json' formats are supported. The format is specified by changing the extension of the method name (e.g. .xml or .json)
- Variables are passed to the API via POST
- Your dlvr.it api key can be found in your dlvr.it account at Settings -> Account.
API Methods
List Routes
This method will simply return a list of your routes and their ids.
URL
- https://api.dlvr.it/1/routes.format
Formats
- xml, json
Parameters
key(required) - your API key
Example call to list your routes:
curl -d "key=YOURAPIKEY"\
"https://api.dlvr.it/1/routes.xml"
Example Response for Invalid Key
<?xml version="1.0" encoding="utf-8" ?>
<response status="fail">
<error code="1" msg="Authentication Failure." />
</response>
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
<routes>
<route id="100" name="Route 1" />
</routes>
</response>
List Accounts
This method will simply return a list of your output accounts and their ids.
URL
- https://api.dlvr.it/1/accounts.format
Formats
- xml, json
Parameters
key(required) - your API key
Example call to list your accounts:
curl -d "key=YOURAPIKEY"\
"https://api.dlvr.it/1/accounts.xml"
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
<accounts>
<account id="1" name="Account 1" />
</accounts>
</response>
Post to a Route
This method will post a message to all the outputs of a route.
URL
- https://api.dlvr.it/1/postToRoute.format
Formats
- xml, json
Parameters
key(required) - your API keyid(required) - route idmsg(required) - message
Example call to post a message to a Route:
curl -d "key=YOURAPIKEY" \
-d "id=100" \
-d "msg=HELLOworld" \
"https://api.dlvr.it/1/postToRoute.xml"
Example Failure Response
If posting is partially successful for a route, the accounts that failed will be indicated (and could be retried via postToAccount).
<?xml version="1.0" encoding="utf-8"?>
<response status="fail">
<account id="1" msg="Post Failed." />
</response>
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
<route id="100" msg="posted" />
</response>
Post to an Account
This method will post a message to an output account.
URL
- https://api.dlvr.it/1/postToAccount.format
Formats
- xml, json
Parameters
key(required) - your API keyid(required) - account idmsg(required) - message
Example call to post a message to an Account:
curl -d "key=YOURAPIKEY" \
-d "id=1" \
-d "msg=HELLOworld" \
"https://api.dlvr.it/1/postToAccount.xml"
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<response status="ok">
<account id="1" msg="posted" />
</response>
Request a short url
This method will return a shortened version of a url.
URL
- https://api.dlvr.it/1/shorten.format
Formats
- xml, json, txt
Notes
- Failures when using the txt format are indicated using HTTP response 500 - no text is returned
Parameters
key(required) - your API keyurl(required) - long url
Example call to shorten a url:
curl -d "key=YOURAPIKEY" \
-d "url=http://www.google.com" \
"https://api.dlvr.it/1/shorten.xml"
Example XML Response
<response status="ok">
<shorten long="http://google.com" short="http://dlvr.it/YTV"/>
</response>
Example Text Response
http://dlvr.it/YTV
Error Codes/Messages
| Error | Message |
| 1 | Bad Method / Unexpected Error. |
| 2 | Database Failure. Try Again. |
| 3 | Missing / Invalid API Key. |
| 4 | Authentication Failure. |
| 5 | Transaction Limit Reached |
| 6 | Permission Denied. |
| 101 | Missing / Invalid Route. |
| 102 | Missing / Invalid Account. |
| 103 | Missing / Invalid Message. |
| 104 | Missing / Invalid URL. |
| 105 | Invalid shorten account or URL. |