SOLVED

Re: Lead creation via SOAP is buggy

Go to solution
Anonymous
Not applicable

Lead creation via SOAP is buggy

After much investigation this afternoon, I'm convinced that the system has crucial bugs with regard to Leads created via SOAP.
 
When I create a Lead with the UI, I can do all of the following via SOAP:
  • getLead
  • syncLead to alter attributes, see changes in web UI
  • add the lead to an existing list

When I create a Lead with SOAP, I see different results:
  • can't see it in the web UI
  • getLead is ok
  • syncLead to alter attributes is ok
  • can't add the lead to an existing list (no reason given in response)

It seems that a SOAP-created Lead is only half-recognized by the system.  I can create it and modify it on the back-end, but the front-end is oblivious.
 
I'd assume anyone using SOAP will need to create Leads, so I think this is a significant bug.
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

Got it.  Finally.  Thanks for the help, Kenny.

Here is the correct form of the request, with workspace.  (Note: from the WSDL, it appears that only syncLead supports the ContextHeader.)

 <?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.marketo.com/mktows/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">

  <SOAP-ENV:Header>

    <ns1:AuthenticationHeader>

      <mktowsUserId>OMITTED</mktowsUserId>

      <requestSignature>OMITTED</requestSignature>

      <requestTimestamp>2014-07-17T17:01:53-05:00</requestTimestamp>

    </ns1:AuthenticationHeader>

    <ns1:MktowsContextHeader>

      <targetWorkspace>NAME OF MY WORKSPACE</targetWorkspace>

    </ns1:MktowsContextHeader>

  </SOAP-ENV:Header>

  <SOAP-ENV:Body>

    <tns:paramsSyncLead>

      <leadRecord>

        <Email>starlord@example.com</Email>

        <leadAttributeList>

          <attribute>

            <attrName>FirstName</attrName>

            <attrType>string</attrType>

            <attrValue>Peter</attrValue>

          </attribute>

          <attribute>

            <attrName>LastName</attrName>

            <attrType>string</attrType>

            <attrValue>Quill</attrValue>

          </attribute>

        </leadAttributeList>

      </leadRecord>

      <returnLead>true</returnLead>

    </tns:paramsSyncLead>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

View solution in original post

12 REPLIES 12
Amy_Lepre
Level 7

Re: Lead creation via SOAP is buggy

Have you created a ticket with support? We are creating leads via the SOAP API and are not experiencing the same issues.
Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

I have.
Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

This is the message that I sent.  Maybe you can see an error in it?

The response was status=CREATED, but the Lead does not show up in the web UI.

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.marketo.com/mktows/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">

  <SOAP-ENV:Header>

    <ns1:AuthenticationHeader>

      <mktowsUserId>OMITTED</mktowsUserId>

      <requestSignature>OMITTED</requestSignature>

      <requestTimestamp>2014-07-16T11:16:28-05:00</requestTimestamp>

    </ns1:AuthenticationHeader>

  </SOAP-ENV:Header>

  <SOAP-ENV:Body>

    <tns:paramsSyncLead>

      <returnLead>true</returnLead>

      <leadRecord>

        <leadAttributeList>

          <attribute>

            <attrName>FirstName</attrName>

            <attrValue>Fake</attrValue>

            <attrType>string</attrType>

          </attribute>

          <attribute>

            <attrName>LastName</attrName>

            <attrValue>Guy</attrValue>

            <attrType>string</attrType>

          </attribute>

        </leadAttributeList>

        <Email>fakeguy@example.com</Email>

      </leadRecord>

    </tns:paramsSyncLead>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Kenny_Elkington
Marketo Employee

Re: Lead creation via SOAP is buggy

Hi Grant,

There are several issues with the formatting of your particular SyncLead call.
  • Email is expected prrior to the leadAttributeList
  • in your attributes, attrType must come before attrValue or not at all
  • returnLead needs to be passed after leadAttributeList

Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

Kenny, I implemented your suggestions, but I'm still seeing the same result.  My new lead is still not appearing in the web UI.

Here's the updated request.  This matches your suggestions, right?

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.marketo.com/mktows/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.marketo.com/mktows/">

  <SOAP-ENV:Header>

    <ns1:AuthenticationHeader>

      <mktowsUserId>OMITTED</mktowsUserId>

      <requestSignature>OMITTED</requestSignature>

      <requestTimestamp>2014-07-16T13:39:41-05:00</requestTimestamp>

    </ns1:AuthenticationHeader>

  </SOAP-ENV:Header>

  <SOAP-ENV:Body>

    <tns:paramsSyncLead>

      <leadRecord>

        <email>clarkkent@example.com</email>

        <leadAttributeList>

          <attribute>

            <attrName>FirstName</attrName>

            <attrType>string</attrType>

            <attrValue>Clark</attrValue>

          </attribute>

          <attribute>

            <attrName>LastName</attrName>

            <attrType>string</attrType>

            <attrValue>Kent</attrValue>

          </attribute>

        </leadAttributeList>

      </leadRecord>

      <returnLead>true</returnLead>

    </tns:paramsSyncLead>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>





Kenny_Elkington
Marketo Employee

Re: Lead creation via SOAP is buggy

Hi Grant,

The <Email> element is case sensitive.  The lack of capitalization is the likely culprit.
Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

Kenny,

I uppercased my "Email" element.  Now my returned lead looks more correct, but I still do not see this Lead in my UI.
Kenny_Elkington
Marketo Employee

Re: Lead creation via SOAP is buggy

How are you searching for this particular lead in the UI?  Are you searching via email address in the Lead Database?
Anonymous
Not applicable

Re: Lead creation via SOAP is buggy

I had a support call with Troy; he figured out the problem.

1) My UI login is restricted to a workspace.  I did not know this.  There is no way (that I can find) for me to see if I am locked to a workspace or what workspace that is.

Marketo Problem 1: Users need to be able to see their workspace restrictions.

2) My SOAP credentials are not restricted to a workspace, so it was writing my Leads to the "default" workspace, which my UI can't see.

I need to make my SOAP write Leads to the correct workspace.  The docs say I can do this by setting a Context Header.  Howerver, the docs don't actually tell me what the XML for a Context Header looks like.  That's kind of a botch-up, isn't it?

Marketo Problem 2: Docs need to show what a Context Header looks like in XML.

Troy is going to get back to me on the Context Header format.  When I get it, I will report back here and mark it answered.