Advertisement
Guest User

Untitled

a guest
Aug 6th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. Endpoints for Batch Processing
  2.  
  3. There are 3 endpoints available for batch processing up to 50 prospects at a time:
  4.  
  5. /api/prospect/version/3/do/batchCreate
  6.  
  7. /api/prospect/version/3/do/batchUpdate
  8.  
  9. /api/prospect/version/3/do/batchUpsert
  10.  
  11. These endpoints expect a query variable called "prospects" which holds either JSON or XML encoded data.
  12.  
  13. JSON Example:
  14.  
  15. {
  16. "prospects": {
  17. "1234": {
  18. "first_name": "New first name",
  19. "last_name": "New last name"
  20. },
  21. "some@email.com": {
  22. "first_name": "New first name",
  23. "last_name": "New last name"
  24. },
  25. "some.other@email.com": {
  26. "first_name": "New first name",
  27. "last_name": "New last name"
  28. }
  29. }
  30. }
  31. XML Example:
  32.  
  33. <prospects>
  34. <prospect identifier="1234">
  35. <first_name>New first name</first_name>
  36. <last_name>New last name</last_name>
  37. </prospect>
  38. <prospect identifier="some@email.com">
  39. <first_name>New first name</first_name>
  40. <last_name>New last name</last_name>
  41. </prospect>
  42. <prospect identifier="some.other@email.com">
  43. <first_name>New first name</first_name>
  44. <last_name>New last name</last_name>
  45. </prospect>
  46. </prospects>
  47. If using batchCreate, you'll need to provide a valid and unique email address for each prospect. The batchUpdate and batchUpsert endpoints allow the use of a prospect ID or prospect email address.
  48.  
  49. Example:
  50.  
  51. /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"}}}&api_key=&user_key=
  52.  
  53. The endpoints will return either:
  54.  
  55. - a generic error in case of a global error (for instance authentication failed, or invalid format of “prospects” variable);
  56. - an array of errors for individual prospects that were not processed successfully (prospects that were processed successfully will not be listed);
  57. - a “success” type response if everything went OK
  58.  
  59. The return value will either be XML or JSON (XML by default. If you want JSON, then add “&format=json” to your HTTP query).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement