Push leads to Marketo with program status | Community
Skip to main content
July 3, 2018
Question

Push leads to Marketo with program status

  • July 3, 2018
  • 2 replies
  • 4450 views

Hello, we are currently using  POST /rest/v1/leads/push.json to add leads to a specific program (either existing leads or new leads).
We need to, in the same request, add the program status that this lead will receive, for example:
{ "input" : [{"name" : "Example", "programStatus" : "Registered"}] }


Currently all leads added to a program through this request receives a status of "Invited" (Event channel).I don't think that it's optimal to send four requests, one for this bulk lead push to Marketo, and another three to update program statuses of grouped leads.

Am I going through the wrong approach here?

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
July 3, 2018

Not sure I understand the question. What are the "four requests" if everyone is supposed to get the same status? Are you trying to set different statuses per lead in the input array?

July 3, 2018

Yes, each lead may receive different statuses.

On Mon, 2 Jul 2018 at 20:32 Sanford Whiteman <marketingnation@marketo.com>

SanfordWhiteman
Level 10
July 3, 2018

But why "one bulk lead push" -- surely in this case it is clearer to do 4 calls to Push Lead, one for each target status. There isn't another endpoint that is more bulk-ified for setting progression status alone (except for the bulk import endpoint, which could be leveraged by adding to a list and then changing status in a flow).

July 3, 2018

Hi Sanford, here is the code that I'm using to push leads to Marketo:

$result = $this->marketo->pushLeads([

"programName" => $programName,

"source" => "InEvent",

"reason" => "API Integration",

"lookupField" => $lookupField,

"programStatus" => "Registered",

"input" => $leads

], true);

$result = json_decode($result, true);

Here is the result:

array(3) {

  ["requestId"]=>

  string(16) "9888#164600e03dc"

  ["result"]=>

  array(4) {

    [0]=>

    array(2) {

      ["id"]=>

      int(42)

      ["status"]=>

      string(7) "updated"

    }

    [1]=>

    array(2) {

      ["id"]=>

      int(1)

      ["status"]=>

      string(7) "updated"

    }

    [2]=>

    array(2) {

      ["id"]=>

      int(6)

      ["status"]=>

      string(7) "updated"

    }

    [3]=>

    array(2) {

      ["id"]=>

      int(39)

      ["status"]=>

      string(7) "updated"

    }

  }

  ["success"]=>

  bool(true)

}

It says everything is fine, but nothing changed on my program:

This program uses channel "Live Event", that have the following progression statuses:

  {

  "id": 4,

  "name": "Live Event",

  "applicableProgramType": "event",

  "progressionStatuses": [

  {

  "name": "Not in Program",

  "step": 0,

  "description": null,

  "success": false,

  "hidden": false

  },

  {

  "name": "Invited",

  "step": 10,

  "description": null,

  "success": false,

  "hidden": false

  },

  {

  "name": "Registered",

  "step": 20,

  "description": null,

  "success": false,

  "hidden": false

  },

  {

  "name": "No Show",

  "step": 30,

  "description": null,

  "success": false,

  "hidden": false

  },

  {

  "name": "Attended",

  "step": 40,

  "description": null,

  "success": true,

  "hidden": false

  }

  ],

  "createdAt": "2017-07-06T17:58:49Z+0000",

  "updatedAt": "2017-07-06T17:58:49Z+0000"

  }

Thanks.

SanfordWhiteman
Level 10
July 3, 2018

Please highlight the code using the Advanced Editor's syntax highlighter and then we'll continue.

July 3, 2018

Sorry about that.. here is the code that I'm using to push leads to Marketo (following the documentation here: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/pushToMarketoUsingPO… ):

// Gather the result

$result = $this->marketo->pushLeads([

"programName" => $programName,

"source" => "InEvent",

"reason" => "API Integration",

"lookupField" => $lookupField,

"programStatus" => "Registered",

"input" => $leads

], true);

$result = json_decode($result, true);

These are the allowed parameters by this request:

PushLeadToMarketoRequest {

input (Array[Lead], optional),

lookupField (string, optional),

partitionName (string, optional),

programName (string, optional),

programStatus (string, optional),

reason (string, optional),

source (string, optional)

}

Here is the result:

array(3) {

  ["requestId"]=>

  string(16) "9888#164600e03dc"

  ["result"]=>

  array(4) {

    [0]=>

    array(2) {

      ["id"]=>

      int(42)

      ["status"]=>

      string(7) "updated"

    }

    [1]=>

    array(2) {

      ["id"]=>

      int(1)

      ["status"]=>

      string(7) "updated"

    }

    [2]=>

    array(2) {

      ["id"]=>

      int(6)

      ["status"]=>

      string(7) "updated"

    }

    [3]=>

    array(2) {

      ["id"]=>

      int(39)

      ["status"]=>

      string(7) "updated"

    }

  }

  ["success"]=>

  bool(true)

}

It says everything is fine and updated, but nothing changed on my program:

This program uses channel "Live Event", that have the following progression statuses:

{

   "id":4,

   "name":"Live Event",

   "applicableProgramType":"event",

   "progressionStatuses":[

      {

         "name":"Not in Program",

         "step":0,

         "description":null,

         "success":false,

         "hidden":false

      },

      {

         "name":"Invited",

         "step":10,

         "description":null,

         "success":false,

         "hidden":false

      },

      {

         "name":"Registered",

         "step":20,

         "description":null,

         "success":false,

         "hidden":false

      },

      {

         "name":"No Show",

         "step":30,

         "description":null,

         "success":false,

         "hidden":false

      },

      {

         "name":"Attended",

         "step":40,

         "description":null,

         "success":true,

         "hidden":false

      }

   ],

   "createdAt":"2017-07-06T17:58:49Z+0000",

   "updatedAt":"2017-07-06T17:58:49Z+0000"

}

Thanks.