4 Replies Latest reply on Jul 10, 2018 2:51 PM by Phillip Wild

    Postman bulk import of leads - no response?

    Phillip Wild

      Hi everyone

       

      I'm trying to bulk update some leads. I have a csv file with Marketo ID in one column, and the field value I'd like to update in the other.

       

      I'm using Postman to try and create the job using this documentation: http://developers.marketo.com/rest-api/bulk-import/

       

      Here is what I'm trying to do in Postman:

       

      https://REDACTED.mktorest.com/rest/bulk/v1/leads.json?format=csv&access_token=REDACTED&content-type=multipart/form-data;%20boundary=boundary&lookupField=id

       

      (I read that the boundary field is sort of arbitrary - you can call it what you like)

       

      My raw body:

       

      --boundary
      Content-Disposition: form-data; name="file"; filename="agent_clusters.csv"
      
      id,agentCluster
      515309,NGJ
      
      
      --boundary--
      

       

      And form-data:

       

      agent_clusters, and the file I uploaded next to that in the Postman interface.

       

      So when I do this, I get....absolutely nothing. Zero. No response at all, at least in the regular spot in Postman. Which of course, makes this quite difficult to troubleshoot! Any ideas? When I make the file bigger than 1mb I get a "file size exceeded" error, but other than that I can't get any response output at all.

        • Re: Postman bulk import of leads - no response?
          Sanford Whiteman
          • Content-Type is an HTTP header, not a parameter
          • the path is /bulk/v1/leads.json, not /rest/bulk/v1/leads.json
          • you shouldn't be faced with creating a muiltipart/form-data payload on your own; even in Postman, the form-data type does this for you
          1 of 1 people found this helpful
            • Re: Postman bulk import of leads - no response?
              Phillip Wild

              Thanks Sanford! Silly errors

               

              I'm now getting a response (great) but it seems I'm still missing a small piece of the puzzle. Here's what I have now:

               

              Parameters:

               

              format:csv

              access_token:REDACTED

              lookupField:id

               

              Headers:

               

              Content-Type: multipart/form-data; boundary=--------------------------WebKitFormBoundaryBQACkJZyaiIAXogC

               

              Body:

               

              form-data: agent_clusters (with file selected)

               

              raw:

              ------WebKitFormBoundaryBQACkJZyaiIAXogC

              Content-Disposition: form-data; name="file"; filename="agent_clusters.csv"

               

              id,agentCluster

              513191,Classic

              513220,Classic

              513238,Active

              513252,Classic

              ------WebKitFormBoundaryBQACkJZyaiIAXogC--

               

               

              And I'm getting this error:

               

              {

                  "requestId": "1867b#16484baabbf",

                  "success": false,

                  "errors": [

                      {

                          "code": "1002",

                          "message": "Missing value for required parameter 'file'"

                      }

                  ]

              }

               

               

              I've also tried adding "file" as a parameter, using "agent_clusters.csv" "agent_clusters" and even the URL of where I have uploaded the csv, and none of these change the error I'm getting. Why?

               

              Additionally, one thing I don't understand is why I am putting some of the csv output in the "raw" body of the request despite the fact I'm uploading a csv with all the values.

               

              Thanks!