Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

How to connect to ADvendio - Using SOAP service to login into ADvendio, Using REST service to query data

Sometime you need to connect third-party systems with ADvendio to access Salesforce Data. Here you can find the basic as an example that is used by Dataplan's Journal Designer.

Example:

...

 

Booking Data by Publication Dates

Login into ADvendio, Get the Session-ID

To login into ADvendio thus to get a session-ID, you can send a XML per POST-Method to the ADvendio using e.g. curl like follows:

...

Code Block
languagexml
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <n1:login xmlns:n1="urn:partner.soap.sforce.com">
      <n1:username>YOUR_USERNAME</n1:username>
      <n1:password>YOUR_PASSWORD_AND_TOKEN_TOGETHER</n1:password>
    </n1:login>
  </env:Body>
</env:Envelope>

The result should be the following: 

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <loginResponse>
      <result>
        ...
        <serverUrl>https://na7.salesforce.com/services/Soap/u/42.0/00DA0000000ck3y</serverUrl>
        <sessionId>SESSION_ID</sessionId>
        ...
      </result>
    </loginResponse>
  </soapenv:Body>
</soapenv:Envelope>

In the result, there is serverUrl and sessionId you should use for subsequent calls to ADvendio.

Logout from ADvendio, Release the Session-ID

Assume the serverUrl you got from the login result is https://na7.salesforce.com/services/Soap/u/28.0/00DA0000000ck3y,  to logout from ADvendio thus to release a session-ID, you can send a XML per POST-Method to the ADvendio using e.g. curl like follows:

...

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:enterprise.soap.sforce.com">
            <ns1:sessionId>SESSION_ID</ns1:sessionId>
        </ns1:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
        <invalidateSessions xmlns="urn:enterprise.soap.sforce.com">
            <sessionIds>SESSION_ID</sessionIds>
        </invalidateSessions>
    </soapenv:Body>
</soapenv:Envelope>

The result should be the following:

Code Block
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com">
    <soapenv:Body>
        <invalidateSessionsResponse>
            <result>
                <success>true</success>
            </result>
        </invalidateSessionsResponse>
    </soapenv:Body>
</soapenv:Envelope>

Query Data by Publication-Dates

Short Explanation to mapping:

...

You can find more details here: https://developer.salesforce.com/page/A_Deeper_look_at_SOQL_and_Relationship_Queries_on_Force.com

Possible mapping as example at Dataplans Journal Designer:


No.

Field

Required Field

Note

Example

ADvendio API

1IDYesGlobal unique Advert IDAD9w87ADvendio__CampaignItem__r.Id & ADvendio__PublicationDate__r.Id
2PublicationYesName, ID of the TitleSeattle NewsADvendio__CampaignItem__r.ADvendio__Ad_Price__r.ADvendio__Ad_Spec__r.ADvendio__Placement__r.ADvendio__Site__r.Name
3Issue/DateYesIssue Number/Year and/or Publish Date1/2015 01-12-2015ADvendio__PublicationDate__r.Name & "/" & ADvendio__PublicationDate__r.ADvendio__PublicationDate__c
4CustomerYesName of the AdvertiserBMWADvendio__CampaignItem__r.ADvendio__Media_Campaign__r.ADvendio__Account__r.Name
5ProductNoProduct Key WordX5ADvendio__CampaignItem__r.ADvendio__SelectedBrandProductInformation__c
6SizeYesAdvert Size or Format in Width/Height or ColumnsFullPageADvendio__CampaignItem__r.ADvendio__Height__c & ADvendio__CampaignItem__r.ADvendio__Width__c & ADvendio__CampaignItem__r.ADvendio__NumberOfColumns__c
7BleedNoBleedTRUEADvendio__CampaignItem__r.ADvendio__SetBleed__c
8PlacementNoteNoFree Text informationCampaign 2015ADvendio__CampaignItem__r.ADvendio__Media_Campaign__r.ADvendio__external_Media_Campaign_Name__c
9PlacementCodeNoPlacement RequirementIFC (inside front cover)ADvendio__CampaignItem__r.ADvendio__PreferredPlacement__c
10BookingStatusNoStatus of the ContractFULLPAIDADvendio__CampaignItem__r.ADvendio__BusinessType__c
11SalesRepNoContact personMichael MillerADvendio__CampaignItem__r.ADvendio__Media_Campaign__r.Owner.Name
12FeaturesNoAdditional Info Coupon, Glue Card, Post Card, etc.NoneADvendio__CampaignItem__r.ADvendio__Ad_Price__r.ADvendio__Ad_Spec__r.ADvendio__Ad_Type__r.Name
20AcknowledgmentYesOnce Ad is placed JD writes back the page no. plus additional information.Page 3 top of the Page rightADvendio__Campaign_Item__r.ADvendio__FlatPlanStatus__c

...