Push leads to Marketo with program status

Anonymous
Not applicable

Push leads to Marketo with program status

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.

Tags (1)
11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator

Re: Push leads to Marketo with program status

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?

Anonymous
Not applicable

Re: Push leads to Marketo with program status

Yes, each lead may receive different statuses.

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Push leads to Marketo with program status

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).

Anonymous
Not applicable

Re: Push leads to Marketo with program status

It would be ok to do 4 requests to the same endpoint (push) with different

statuses, but I cannot find a way to provide a specific status on this

request, everything I try, it says it is invalid.

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Push leads to Marketo with program status

OK, you didn't note (or quote) an error before, so that wasn't clear!

I don't have a problem passing "Registered" for programStatus when the channel type supports it (and the lead has not already moved beyond that status in the progression).

Can you post the output of the /rest/asset/v1/channels.json endpoint for your instance?

Anonymous
Not applicable

Re: Push leads to Marketo with program status

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:

Screen Shot 2018-07-03 at 08.15.16.png

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 - Community Moderator

Re: Push leads to Marketo with program status

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

Anonymous
Not applicable

Re: Push leads to Marketo with program status

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/... 😞

// 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:

Screen Shot 2018-07-03 at 08.15.16.png

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.

Anonymous
Not applicable

Re: Push leads to Marketo with program status

Nevermind, I managed to make it work, although I need to make four requests if I want to push several leads that may have four different statuses. The main question was actually if I could set the programStatus inside the input array for each individual lead.

Thank you!