11 Replies Latest reply on Jul 3, 2018 11:59 AM by Mauricio Giordano

    Push leads to Marketo with program status

    Mauricio Giordano

      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.

        • Re: Push leads to Marketo with program status
          Sanford Whiteman

          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?

          • Re: Push leads to Marketo with program status
            Mauricio Giordano

            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.

              • Re: Push leads to Marketo with program status
                Sanford Whiteman

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

                  • Re: Push leads to Marketo with program status
                    Mauricio Giordano

                    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:

                    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.