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.dlvrit.com/1/routes.format

Formats

xml, json

Parameters

key (required) - your API key

Example call to list your routes:

  curl -F "key=YOURAPIKEY"\
          "https://api.dlvrit.com/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.dlvrit.com/1/accounts.format

Formats

xml, json

Parameters

key (required) - your API key

Example call to list your accounts:

  curl -F "key=YOURAPIKEY"\
          "https://api.dlvrit.com/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.dlvrit.com/1/postToRoute.format

Formats

xml, json

Parameters

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

Example call to post a message to a Route:

  curl -F "key=YOURAPIKEY" \
       -F "id=100" \
       -F "msg=HELLOworld" \
       -F "media=@filename.jpg" \
       "https://api.dlvrit.com/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.dlvrit.com/1/postToAccount.format

Formats

xml, json

Parameters

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

Example call to post a message to an Account:

  curl -F "key=YOURAPIKEY" \
       -F "id=1" \
       -F "msg=HELLOworld" \
       -F "media=@filename.jpg" \
       "https://api.dlvrit.com/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.dlvrit.com/1/shorten.format

Formats

xml, json, txt

Notes

This method is only available to paid dlvr.it subscribers
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 -F "key=YOURAPIKEY" \
       -F "url=http://www.google.com" \
       "https://api.dlvrit.com/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
107 Method only available to paid subscribers