Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

Sommaire
maxLevel2

...

NameDescription
methodThe API method you want to call
apikeyYour API Key
username

Your username (Same as your PUBLITRAC login)


*Note that we can provide you a specific user to use the API

mot de passeYour password (Same as your PUBLITRAC login)
parametersThe number of parameters required depend on the method called.


Syntaxe

https://app.publitrac.com/api?method=[Method Name]&apikey=[Your API Key]&username=[Your user]&password=[Your password]&[Your parameters (email, query, viewName, listName)]

Examples


Bloc de code
languagexml
https://app.publitrac.com/api?method=getLeads&apikey=1234e567-890c-123e-4567-8901b234c56&username=MyUser&password=MyPassw0rd&query=<XML representation of your search>
https://app.publitrac.com/api?method=getLead&apikey=1234e567-890c-123e-4567-8901b234c56&username=MyUser&password=MyPassw0rd&email=Email representing your search

...

Url

https://app.publitrac.com/api

Supported

POST

Methode

syncLead

Mandatory Parameters

method : syncLead

apiKey : Your API Key

username : Your username

password : Your password

query : Xml representation of the lead to update

Remarks

This method will add a new lead if the token, the crmLeadId or the email address are not in the database. Unique identifiers are in this order: the ‘token’, the ‘crmLeadId’ and then the ‘email address’.  The email address is always mandatory and must be valid.

It is possible to synchronize your leads with different unicity keys; 

  • Email address is the default unicity key. For any lead in your account, each time the SyncLead method is invoked, the process validates if there is a lead corresponding to their criteria or creates a new one if there is none.
  • Email address and CRM Lead Id : In the instance where a CRM lead Id is added in the Synchronisation, the process will validate if a lead which has both information already exists and updates the leads corresponding to their criteria or creates a new one if there is none. 
  • Token : The token is a cookie that is set on the visitor browser which is used to track the interactions of a lead before and after it's acquisition. The Publitrac token is a string that is similar to "_nl-publitrac.com-1111111111111-11111". If useToken is set to true, PUBLITRAC will find the lead or the anonymous lead with this token and update the information accordingly. If no leads are found, a new lead will be created with this token. This option will over-write all other unicity key rules except the customUnicityKeys.
  • Custom unicity key : In the instance when you need to have a différent unicity key, for example only the crmLeadID, your can define your own by the customUnicityKeys. It will validate if there already is a lead that has the unicity key information and update the leads corresponding to their criteria or create a new one if there is none. This option will over-write all other unicity key rules including the useToken rule.

    ** if there is more than one lead found meeting the criteria and that mergeAnonymous or useToken or crmLeadId was used in the query, the API call will respond with an error.

It is also possible to merge or ignore the Anonymous leads. That means, if you synchronized your leads from a web form, you may want to use a custom unicity key, for example, the CRM Lead ID and make sure to merge the interactions which ocurred before the acquisition based on his Token.  In this case you'll configure  mergeAnonymous to 1 (true) useToken to 0 (false) and specify the corresponding token and crmLeadId in the lead information.

If the values mergeAnonymous or useToken are not set, the default value is set to 0 (false).

Be careful with the following most common errors :

  • The <email></email> node can not be empty or be in an invalid email format
  • Duplicate leads based on the selected unicity key
  • Using the mergeAnonymous without providing a Token value.
  • Have empty values for any fields specified un a unicity key (example the customUnicityKeys with crmLeadId and firstName with these 2 values empty)
  • <language> should be a language code (ISO 639-1). Currently publitrac supports en/fr as Languages. You can save anything you want in this field, but you won't be able to send emails to leads with wrong language.



Examples

Bloc de code
languagexml
titleRequest
<?xml version="1.0" encoding="UTF-8"?>
<request>
    <mergeAnonymous>0</mergeAnonymous>
	<useToken>1</useToken>
	<customUnicityKeys>
		<key>crmLeadId</key>
		<key>customKey2</key>
	</customUnicityKeys>
    <lead>
        <token>_nl-yourdomain.com-1323891914130-53205</token>
        <crmLeadId>CRM_ID134</crmLeadId>
        <firstName>John</firstName>
        <lastName>Smith</lastName>
        <middleName></middleName>
        <company>ACME</company>
        <phone>555-423-2453</phone>
        <email>johnsmith@mydomain.com</email>
        <mailingAddress>134 Ocean Street</mailingAddress>
        <leadSource>New Production ABC</leadSource>
        <originalSource> New Production ABC</originalSource>
        <originalSourceType>Organic</originalSourceType>
        <jobTitle>Software Engineer</jobTitle>
        <score>90</score>
        <postalCode>90211</postalCode>
        <country>USA</country>
        <city>Compton</city>
        <state>CA</state>
        <doNotCall>0</doNotCall>
        <doNotCallReason></doNotCallReason>
        <unsubscribed>0</unsubscribed>
        <unsubscribeCause></unsubscribeCause>
        <unsubscribeReason></unsubscribeReason>
        <fax>555-324-2134</fax>
        <mobile>555-432-1242</mobile>
        <isCustomer>0</isCustomer>
        <isAnonymous>0</isAnonymous>
        <emailInvalid>0</emailInvalid>
        <emailInvalidCause></emailInvalidCause>
        <notes>This lead is very interest in product ABC</notes>
        <suspended>0</suspended>
        <suspendedReason></suspendedReason>
        <blacklisted>0</blacklisted>
        <blacklistedCause></blacklistedCause>
        <customerId></customerId>
        <website>http://www.acme.com</website>
        <language>fr</language>
        <nbrEmployees>4</nbrEmployees>
        <revenue>400000</revenue>
        <customFields>
            <carColor>Red</carColor>
            <carMaker>Infiniti</carMaker>
        </customFields>
    </lead>
</request>

...

The country list is ISO_3166-1 in alpha-2 code


Language

The language is ISO_639-1 (currently supported only en/fr)


Opportunity Objet


Mandatory fields:

  • Id: Your system ID to identify the opportunity.
  • Name: The name of the opportunity.
  • Sales Stages:
    • Prospecting
    • Qualification
    • Needs Analysis
    • Value Proposition
    • Id. Decision Makers
    • Perception Analysis
    • Proposal/Price Quote
    • Negotiation/Review
    • Closed Won
    • Closed Lost
  • Amount: Integer
  • Date Closed: Mandatory if opportunity is closed. Use your own data format.
  • Probability: Integer from 1 to 100
  • Leads: List of lead ids attached to the opportunity. ID is your internal crmLeadId and must have been previously added using addLead method.

...