getMObjects

Retrieves one or more MObjects using a combination of criteria consisting of:

  • Zero or one unique ID, either the Marketo ID or external ID
  • Zero or more attribute filters as name/value/comparison trios
  • Zero or more associated object filters as object name/ID pairs

Returns a list of matching MObjects, all of a single type, up to 100 in a batch, and a stream position token for retrieving successive batches.

Request

Field Name

Required/Optional

Description

type Required The object type you wish to query. Can be one of the following:

  • Opportunity
  • OpportunityPersonRole
  • Program
id Optional Id of the MObject
includeDetails Optional When true will return all attributes for a given MObject. This parameter is only applicable when used with Program MObjects
mObjCriteriaList->mObjCriteria->attrName Optional One or more of the following input parameters may be used

  1. Name: Name of the MObject
  2. Role: The role associated with an OpportunityPersonRole object
  3. Type: The type of an Opportunity object
  4. Stage:- The stage of an Opportunity object
  5. CRM Id: the CRM Id could refer to the Id of the Salesforce campaign connected to a Marketo program. Note: The SFDC Campaign ID needs to be the 18-digit ID.
  6. Created At:
    1. Equals, not equals, less than, less than or equal to, greater than, greater than or equal to
    2. Two “created dates” can be specified to create a date range
  7. Updated At or Tag Type
    (only one can be specified):

    1. Equals, not equals, less than, less than or equal to, greater than, greater than or equal to
    2. Two “created dates” can be specified to create a date range
  8. Tag Value: (Only one can be specified)
  9. Workspace Name: (only one can be specified)
  10. Workspace Id: (only one can be specified)
  11. Include Archive: Applicable only with Program MObject. Set it to true if you wish to include archived programs.
mObjCriteriaList->mObjCriteria->attrValue Optional The value that you wish to use for filtering
mObjCriteriaList->mObjCriteria->comparison Optional One of –

  1. EQ – Equals
  2. NE – Not Equals
  3. LT – Less Than
  4. LE – Less Than or Equals
  5. GT – Greater Than
  6. GE – Greater Than or Equals
mObjAssociationList->mObjAssociation->mObjType Optional
mObjAssociationList->mObjAssociation->id Optional The id of the associated object (Lead/Company/Opportunity)
mObjAssociationList->mObjAssociation->externalKey Optional A custom attribute of the associated object
streamPosition Optional Used to paginate through multiple result sets. The value passed is the value returned by the previous getMObjects call.

Request XML

Response XML

Sample Code – PHP

Sample Code – Java

Sample Code – Ruby