syncMObjects

Accepts an array of MObjects to be created or updated, up to a maximum to 100 per call, and returns the outcome (status) of the operation (CREATED, UPDATED, FAILED, UNCHANGED, SKIPPED) and the Marketo IDs of the MObject(s). The API can be called in one of three operation modes:

  1. INSERT – Only insert new objects, skip existing objects
  2. UPDATE – Only update existing objects, skip new objects.
    • For the Program MObject, the API can only be called in the UPDATE mode to add new period cost information or add/update tags/channel for existing programs. (tags/channels must already be defined, i.e. One cannot create new tags/channels through the API)
  3. UPSERT – Insert new objects and update existing objects

The UPDATE and UPSERT operations use the ID as the key. In a single API call some updates may succeed and some may fail. An error message will be returned for each failure

Request

Field Name

Required/Optional

Description

mObjectList->mObject->type Required Can be one of:

  1. Program
  2. Opportunity
  3. OpportunityPersonRole
mObjectList->mObject->id Required Id of the MObject. You may specify up to 100 MObjects per call.
mObjectList->mObject->typeAttribList->typeAttrib->attrType Required Cost (only used while updating the Program MObject)

Can be one of:

  1. Cost
  2. Tag
mObjectList->mObject->typeAttribList->typeAttrib->attrList->attrib->name Required For Program MObject, the following attributes can be passed as name-value pairs:

For Cost:

  1. Month (Required)
  2. Amount (Required)
  3. Id (Cost Id – Optional)
  4. Note (Optional)

For Tag/Channel:

  1. Type (Required)
  2. Value (Required)

For Opportunity MObject, all the fields from the output of the describeMObject can be passed as name-value pairs. The below list are all optional fields and the standard set of attributes. You may have additional fields on the Opportunity MObject that were created through a support request.

  1. Amount
  2. CloseDate
  3. Description
  4. ExpectedRevenue
  5. ExternalCreatedDate
  6. Fiscal
  7. FiscalQuarter
  8. FiscalYear
  9. ForecastCategoryName
  10. IsClosed
  11. IsWon
  12. LastActivityDate
  13. LeadSource
  14. Name
  15. NextStep
  16. Probability
  17. Quantity
  18. Stage
  19. Type

For OpportunityPersonRole MObject, you can supply all the fields from the output of describeMObject as name-value pairs. The standard set of attributes on OpportunityPersonRole MObject are listed here:

  1. OpportunityId (Required)
  2. PersonId (Required)
    1. Corresponds to the person/contact ID in Marketo.
  3. Role (Optional)
  4. ExternalCreatedDate (Optional)
  5. IsPrimary (Optional)
  6. Role (Optional)
mObjAssociationList->mObjAssociation->mObjType Optional Used to update Opportunity/OpportunityPersonRole MObjects using the id or external key of an associated object. Associated objects can be one of:

  1. Company (to update Opportunity MObject)
  2. Lead (to update OpportunityPersonRole MObject)
  3. Opportunity (to update OpportunityPersonRole MObject)
mObjAssociationList->mObjAssociation->id Optional The id of the associated object (Lead/Company/Opportunity)
mObjAssociationList->mObjAssociation->externalKey Optional A custom attribute of the associated object

Request XML

Response XML

Sample Code – PHP

Sample Code – Java

Sample Code – Ruby