Api Integration

In this article we will discuss using our API to integrate your software with Xzazu to create inbound leads. For a full list of available API calls please visit:
https://interface.xzazu.com/swagger/ui/index

The Xzau API is fully swagger compliant, there are a lot of tools available to automatically generate client code.

Authentication

The Xzazu Api uses ApiKey\Subdomain authentication for every request. To start integration between Your app  and Xzazu the user needs to supply both their subdomain and api key. 

The following headers need to be supplied for every Api call:

api_key 

subdomain 

The authentication can be tested by calling the following action on the Xzazu Api:

 GET  https://interface.xzazu.com/v1/User/Me

 If authentication is successful a user object will be returned:

{
      "Name":"YOURCOMPANY",
      "Type":"Inbound"
}

Campaigns \ Campaign versions

Supplying a Campaign \ Version with a lead is not mandatory. We do recommend using Campaigns to keep your lead flow ordered and controllable.

The list of available campaigns can be retrieved from the Xzazu Api:

GET  https://interface.xzazu.com/v1/InboundLead/Campaigns

A list of Lead Campaigns will be returned:

{
      "Campaigns":[
                {
                "Id":1,
                "Name":"Campaign 1"             
      },
                {
                "Id":2,
                "Name":"Campaign1"             
      },
                {
                "Id":3,
                "Name":" Campaign 3"             
      }        
   ]
}

If there are no active an empty array will be returned in the Campaigns node.

The list of available campaign versions for the campaign can be retrieved from the Xzazu api: 

 GET  https://interface.xzazu.com/v1/InboundLead/Campaigns/{{campaignId}}/Versions

 A list of Campaign Versions will be returned:

 

{
      "CampaignVersions":[
                {
                "Id":1,
                "Name":"\\Campaign 1\\Version1",
                "Status":"Published"             
      }        
   ]
}

Verticals

Supplying a vertical with a lead is not mandatory. We do recommend using verticals to keep your lead flow ordered and controllable.

The list of available in your Xzazu can be retrieved from the Xzazu api: 

 GET https://interface.xzazu.com/v1/InboundLead /Verticals

 A list of Verticals will be returned:

 

{
      "Verticals":[
                {
                "Id":2,
                "Name":"Insurance\\Car"             
      }        
   ]
}

Lead Fields

The list of fields can be retrieved from the Xzazu Api: 

 If Campaign is not used:

 GET  https://interface.xzazu.com/v1/InboundLead/Fields

if a Campaign, Campaign Version and Vertical are selected:

GET  https://interface.xzazu.com/v1/InboundLead/Fields/{{campaignId}}/{{campaignVersionId}}/ {{verticalId}}

A list of fields will be returned:  

{

   "Fields":[

      {

         "RegEx":"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+",

         "Label":"Email",

         "Name":"Email",

         "FieldType":"Email",

         "Required":false

      },

      {

         "Label":"First Name",

         "Name":"First Name",

         "FieldType":"Text",

         "Required":false,

         "Value":"Chivan"

      },

      {

         "Label":"Last Name",

         "Name":"Last Name",

         "FieldType":"Text",

         "Required":false,

         "Value":"Tiebosch"

      },

      {

         "Label":"Phone Number",

         "Name":"Phone Number",

         "FieldType":"PhoneNumber",

         "Required":false

      },

      {

         "Choices":[

            "Miss",

            "Mrs",

            "Mr"

         ],

         "Label":"Title",

         "Name":"Title",

         "FieldType":"Choice",

         "Required":false,



      }

   ]

}

 

Field Types

FieldType

Description

Validation Properties

Post Value Sample

Note

Text

json string

MinLength (int) (optional)
MaxLength (int) (optional)
RegEx (string) (optional)

“Text/n/r”                     

standard json escaping of characters 

LongText

json string

MinLength (int) (optional)
MaxLength (int) (optional)
RegEx (string) (optional)

“Text/n/r”

standard json escaping of characters 

Date

"yyyy-MM-dd"

MinValue (date) (optional)
MaxValue (date) (optional)

"2012-04-23"  

 

DateAndTime

"yyyy-MM-ddTHH:mm:ss:uuuZ" in UTC

MinValue (date) (optional)
MaxValue (date) (optional)

"2012-04-23T18:25:43.511Z"  

 

Number

decimal integer

MinValue (int) (optional)
MaxValue (int) (optional)

2

 

Decimal

decimal notation with . And optional exponential value

MinValue (decimal) (optional)
MaxValue (decimal) (optional)

2953.145

0,134E-05

 

Boolean

true or false in small letters without quotation marks

 

true

 

Choice

json string from choice options

Choices (array of string) (always)

"choice1"

standard json escaping of characters 

MultipleChoice

json array from  choice options

Choices (array of string)

(always)

["choice1","choice2"]

standard json escaping of characters 

List

json array

 

["item1","item2"]

standard json escaping of characters 

Monetary

decimal notation with . without currency symbol

MinValue (decimal) (optional)
MaxValue (decimal) (optional)

ISOCurrencyCode (string) (always)

23.14

 

Geo

Object containing Latitude, Longitude and optional PointDescription as json string

 

{"Latitude":51.917827,"Longitude":4.484873,

"PointDescription":"Some address"}

standard json escaping of characters 

Email

json string

MinLength (int) (optional)
MaxLength (int) (optional)
RegEx (string) (optional)

"info@xzazu.com"

standard json escaping of characters 

PhoneNumber

json string suggested: + country code notation without spacing

MinLength (int) (optional)
MaxLength (int) (optional)
RegEx (string) (optional)

"+31107371647"

standard json escaping of characters 

URL

object with value containing URL and optional Link Text

MinLength (int) (optional)
MaxLength (int) (optional)
RegEx (string) (optional)

{"Url":"http://www.xzazu.com","LinkText":"Xzazu"}

standard json escaping of characters 

 

Creating an Inbound Lead

Posting leads to the Xzazu Api:

 POST: https://api.xzazu.com/v1/InboundLead/Create

 if a Campaign, Version and Vertical are  not used the CampaignId and CampaignVersion can be omitted.

If no Verticals are used, the VerticalId can be omitted.

If lead did not originate from an Affiliate Partner, PartnerContractId can be omitted.

{

   "CampaignId":1,

PartnerContractId: 1,

   "CampaignVersion":1,

   "VerticalId":2,

   "Fields":[

      {

         "Name":"Email",

         "Value":"chivan@xzazu.com"

      },

      {

         "Name":"First Name",

         "Value":"Chivan"

      },

      {

         "Name":"Last Name",

         "Value":"Tiebosch"

      },

      {

         "Name":"Phone Number",

         "Value":"+3110737164"

      },

      {

         "Name":"Title",

         "Value":"Mr"

      }

   ],

   "Source":"Source"

}

A leadId will be returned:

{   "InboundLeadId": "201806IL0022528" }