Advertisement
Guest User

Untitled

a guest
Jun 19th, 2015
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. Note that there is a limit of 50 records per batch and we do allow concurrent calls. Traditionally we have limited this to 5 concurrent calls but have removed this limit for now.
  2.  
  3. Endpoints available for batch processing:
  4.  
  5. /api/prospect/version/3/do/batchCreate
  6. /api/prospect/version/3/do/batchUpdate
  7. /api/prospect/version/3/do/batchUpsert
  8.  
  9. These endpoints expect a variable called “prospects” which holds either JSON or XML encoded data in the following format:
  10.  
  11. // If you want to send JSON:
  12. {
  13. “prospects”: {
  14. “1234”: {
  15. “first_name”: “New first name”,
  16. “last_name”: “New last name”
  17. },
  18. “some@email.com”: {
  19. “first_name”: “New first name”,
  20. “last_name”: “New last name”
  21. },
  22. “some.other@email.com”: {
  23. “first_name”: “New first name”,
  24. “last_name”: “New last name”
  25. }
  26. }
  27. }
  28.  
  29. OR
  30.  
  31. // If you’d rather send XML
  32. <prospects>
  33. <prospect identifier="1234">
  34. <first_name>New first name</first_name>
  35. <last_name>New last name</last_name>
  36.  
  37. </prospect> <prospect identifier="some@email.com"> <first_name>New first name</first_name> <last_name>New last name</last_name> </prospect> <prospect identifier="some.other@email.com"> <first_name>New first name</first_name> <last_name>New last name</last_name> </prospect> </prospects>
  38. (1234 being a Pardot prospect ID).
  39.  
  40. The endpoints will return either:
  41.  
  42. - a generic error in case of a global error (for instance authentication failed, or invalid format of “prospects” variable);
  43. - an array of errors for individual prospects that were not processed successfully (prospects that were processed successfully will not be listed);
  44. - a “success” type response if everything went OK
  45.  
  46. The return value will either be XML or JSON (XML by default. If you want JSON, then add “&format=json” to your HTTP query).
  47.  
  48. Here is an example:
  49.  
  50. /api/prospect/version/3/do/batchUpdate?prospects={"prospects":{"some@email.com":{"first_name":“New first name”,“last_name”:“New last name”},“1234”:{"first_name":“New first name”,“last_name”:“New last name”}}}
  51.  
  52. …which in my case will return:
  53.  
  54. <?xml version=“1.0” encoding=“UTF-8”?>
  55. <rsp stat="ok" version="1.0">
  56. <errors/>
  57.  
  58. </rsp>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement