dlvr.it API Specification


Using the API

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 Queues

This method will simply return a list of your Queues and their ids.

URL

https://api.dlvr.it/1/queues.format

Formats

xml, json

Parameters

key (required) - your API key

Example call to list your queues:

  curl -d "key=YOURAPIKEY"\
          "https://api.dlvr.it/1/queues.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="Queue 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" service="ServiceName" url="http://www.example.com/accountid"/>
        </accounts>
    </response>
            

Post to a Route (or Queue)

This method will post a message to all the outputs of a route or Queue.

URL

https://api.dlvr.it/1/postToRoute.format

Formats

xml, json

Parameters

key (required) - your API key
id (required) - route or queue id
msg (required) - message
shared (optional) - use shared url where applicable
title (optional) - title to use if shared is set
media (optional) - uploaded image (requires POST w/ multipart encoding)
posttime (optional) - a future post time (only for Qs)
order (optional) - 'first' or 'last', to specifiy order in Q

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 key
id (required) - account id
msg (required) - message
shared (optional) - use shared url where applicable
title (optional) - title to use if shared is set
media (optional) - uploaded image (requires POST w/ multipart encoding)

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 key
url (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.
106 Image too large or wrong type.
999 dlvr.it is currently offline