Skip to main content
Apr 10, 2014 6:33 PM UTC
Question

Create Opportunities

I'm trying to create opporutnities via the API but running into an issue.  I've tried quite a few variations of the below but always seem to get the same error.  Can anyone see the error in the format that I'm just not seeing?  Thank you for any help!!

{:success_sync_m_objects=>
  {:result=>
    {:m_obj_status_list=>
      {:m_obj_status=>
        {:id=>nil,
         :status=>"FAILED",
         :error=>"Value for attribute 'Name' is required"}}}}}

Request:
<?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:ns1="http://www.marketo.com/mktows/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header>
    <ns1:AuthenticationHeader>
      <mktowsUserId>stuff</mktowsUserId>
      <requestSignature>more stuff</requestSignature>
      <requestTimestamp>more stuff</requestTimestamp>
    </ns1:AuthenticationHeader>
  </env:Header>
  <env:Body>
    <ns1:paramsSyncMObjects>
      <mObjectList>
        <mObject>
          <type>Opportunity</type>
          <Name>TEST_OPP1</Name>
          <typeAttribList>
            <typeAttrib>
              <attrList>
                <attrib>
                  <Name>Name</Name>
                  <Value>TEST_OPP1</Value>
                </attrib>
              </attrList>
            </typeAttrib>
          </typeAttribList>
        </mObject>
      </mObjectList>
      <operation>INSERT</operation>
    </ns1:paramsSyncMObjects>
  </env:Body>
</env:Envelope>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Apr 10, 2014 9:56 PM UTC
http://integratingthecloud.com/opportunity-marketo-api/ is a good article that outlines how to create opportunities using the API
Translate
Apr 11, 2014 1:47 PM UTC
Just to confirm, in order to create Opportunities via the API I need to call support to have two custom fields created, otherwise the API will not accept the create opportunity call as valid?
Translate