Zoho CRM to Woocommerce oAuth Authentication implementation.

Zoho CRM to Woocommerce oAuth Authentication implementation.

Hi 

I need to implement the scenario that when a product is created in Zoho CRM it should triggers a creation of Products in Woocommerce. I found out the api for creating product. But the real problem is how to call the rest api via Zoho CRM which uses oAuth Authentication.Please help me in building headers of oAuth. 

It works fine for get method getting the list of products from woocommerce. But fails in post method which is responsible for creation of Product. It frequently shows Internal Exception.(not showing what is specific error)


My code://Internal Exception

 headers_map=map();
body_map = Map();
body_map.put("name", "product_name");
headers_map.put("oauth_consumer_key","xxxxxxxxxxxxxxxxx");//consumer_key
headers_map.put("oauth_consumer_secret","xxxxxxxxxxxxxxxxxx");//consumer_secret
 headers_map.put("oauth_signature", "");
headers_map.put("oauth_timestamp","2343433535");
headers_map.put("oauth_nonce","GYjzVBB8Y0ZFabxSWbWTgmZeNu2VS4cg");
headers_map.put("oauth_signature_method","HMAC-SHA256");
 headers_map.put("oauth_version","1.0");
 my_url=" https://www.abcdefgh.com/wp-json/wc/v2/products?";
product_data_inserted = postUrl(my_url,body_map,headers_map,false);



I tried changing the header as

headers_map.put("consumer_key", "xxxxxxxxxxxx");
headers_map.put("consumer_secret", "xxxxxxxxxxxx");

But it doesn't works results in same Internal Exception.


Please help me in oAuth Authentication via Rest API in Zoho CRM.