itDuzzit API

Any duzzit that you build on the itDuzzit platform can be exposed as a web service API.

On this page:

  • Enabling an API for a Duzzit
  • API Endpoint
  • Authentication
  • Output Formats
  • Testing the API

Enabling an API for a Duzzit

On the itDuzzit Settings popup, select the tab labeled “Do It Settings”. There you will find an option to expose your duzzit as an API.

Go to Top


API Endpoint

The API URL for a duzzit is in the following format:

https://www.itduzzit.com/[[Duzzit.UrlContext]]/api/[[Duzzit.UrlFilename]].xml

Where:

[[Duzzit.UrlContext]] is the the URL context. For Duzzit Library duzzits, the context is “duzz”, for custom duzzits, the context is your itDuzzit username.
[[Duzzit.UrlFilename]] is either the numeric identifier of the duzzit or the custom url that you define on the Settings page.
.xml is the file extension that determines the format of the output. Options include:

  • .xml – returns the data in XML format
  • .json – returns the data in JSON format
  • .atom – returns the data as an ATOM feed
  • .html -returns the results as a formatted HTML snippet. For example, list results are returned within an HTML <table></table> element.
  • .outputVariable – To return the raw data of any output variable, use the output variable name. For example use .message to return the message variable.

The API accepts both GET and POST requests and will return an HTTP 200 status upon successful completion.

Go to Top


Authentication

There are two methods of authenticaion:

1) Token-based Authentication

Your API token is a password that can be changed on your account settings page. When calling an API, include the token as a URL parameter. For example:

https://www.itduzzit.com/duzz/api/my-contact-search?search=Doe&token=12345

2) HTTP Basic Authentication

You can use your itDuzzit username and password to authenticate API calls using HTTP Basic authentication.

Go to Top


Output Formats

To demonstrate the various output formats, we’ll use the following example that returns a list of contacts and a count output.

XML Output Format

<response>
  <header>
    <name>My Contact Search</name>
    <status>success|error</status>
    <message></message>
  </header>
  <results>
    <count>2</count>
    <contacts>
      <entry>
        <email>john@doe.com</email>
        <name>John Doe</name>
      </entry>
      <entry>
        <email>jane@doe.com</email>
        <name>Jane Doe</name>
      </entry>
    </contacts>
  </results>
</response>

Within the <results></results> element there will be elements to match all of the duzzit’s output variables. For list types, each entry is enclosed within an “entry” element.

JSON Output Format

{
  "header": {
    "name":"My Contact Search",
    "status":"success",
    "message":""
   },
  "count":"2",
  "contacts": [
    {"email":"john@doe.com","name":"John Doe"},
    {"email":"jane@doe.com","name":"Jane Doe"}
    ]
}

Go to Top


Testing the API

To test the API, select the “Get as API” link under the duzzit options.

This will launch a popup that will show you the API URL. Select an output format, enter your input values, and then click on the link to test the API.

Go to Top

Comments are closed.