Skip to main content
April 10, 2014
Question

Create Opportunities

  • April 10, 2014
  • 2 replies
  • 790 views
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

April 10, 2014
http://integratingthecloud.com/opportunity-marketo-api/ is a good article that outlines how to create opportunities using the API
April 11, 2014
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?