Update my code from API v1 to v2

Update my code from API v1 to v2

Hi guys

Ive got a simple form that when submitted inserts the form values into Zoho. The Zoho code is very simple:

  1. $curl_connection =   curl_init('https://crm.zoho.com/crm/WebToLeadForm');
  2. curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
  3. curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
  4. curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
  5. curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
  6. curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
  7. $post_data['xnQsjsdp'] = '3e096710fcca7d9cf25421fef7a9edb67c05bd02cff63dda8de45923ec970c65';
  8. $post_data['zc_gad'] = '';
  9. $post_data['xmIwtLD'] = 'e26d36527a992b9497c415f16b4a6b71a7ebc453a2c829f127da2d57f7b2c299';
  10. $post_data['actionType'] = 'TGVhZHM=';
  11. $post_data['Email'] = "test@test.com";
  12. $post_data['Phone'] = "1234";
  13. $post_data['Company'] = "tester";
  14. foreach ( $post_data as $key => $value){
  15.     $post_items[] = $key . '=' . $value;
  16. }
  17. $post_string = implode ('&', $post_items);
  18. curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
  19. $result = curl_exec($curl_connection);
  20. curl_close($curl_connection);

What would the above be using the API v2 ?

Thanks