For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho CRM: Upload a Product Photo using Deluge

Zoho CRM: Upload a Product Photo using Deluge

What?
A quick article to remind me on how to upload a photo using CRM API v2. Yes it's documented and yes it still confuses me now and again. So I'm writing this to remind me and to keep reminding me of how to do this.

Why?
My use-case is that I have a photo in Zoho Creator but the source doesn't really matter as the part I struggled on was uploading it to CRM. I want to update the photo in the CRM record.

How?
So we have to do the usual which is download the photo using invokeUrl then we set the paramname not to attachment but to file. We then use another invokeUrl to upload the photo to CRM:
copyraw
// init
v_AppOwner = "joel_the_awesomest";
v_AppName = "joels_app";
v_ReportName = "My_Report";
// specify your CRM record ID for this product
v_CrmProductID = 1234567890123456789;
// specify your Creator record ID holding the image
v_CreatorQuoteID = 9876543210987654321;
//
// get the full details of the Creator record
r_GetFullRecord = zoho.creator.getRecordById(v_AppOwner,v_AppName,v_ReportName,v_CreatorQuoteID,"joels_creator");
if(!isnull(r_GetFullRecord.get("data")))
{
	r_CreatorRecord = r_GetFullRecord.get("data");
	v_CreatorPhotoUrl = ifnull(r_CreatorRecord.get("Display_Photo"),"");
	if(v_CreatorPhotoUrl!="")
	{
		//
		// download photo from your Creator (change connection and check TLD)
		v_Endpoint1 = "https://creatorapp.zoho.com" + v_CreatorPhotoUrl;
		r_CreatorPhoto = invokeUrl
		[
			url: v_Endpoint1
			type: GET
			connection: "joels_creator"
		];
		info r_CreatorPhoto;
		//
		// set the param name to file (this is important)
		r_CreatorPhoto.setParamName("file");
		//
		// upload the photo to CRM (and prevent workflows from running)
		v_Endpoint2 = "https://www.zohoapis.com/crm/v2/Products/" + v_CrmProductID + "/photo?restrict_triggers=workflow";
		r_CrmPhoto = invokeurl
		[
			url: v_Endpoint2
			type: POST
			files: r_CreatorPhoto
			connection: "joels_crm"
		];
		info r_CrmPhoto;
	}
}
  1.  // init 
  2.  v_AppOwner = "joel_the_awesomest"
  3.  v_AppName = "joels_app"
  4.  v_ReportName = "My_Report"
  5.  // specify your CRM record ID for this product 
  6.  v_CrmProductID = 1234567890123456789
  7.  // specify your Creator record ID holding the image 
  8.  v_CreatorQuoteID = 9876543210987654321
  9.  // 
  10.  // get the full details of the Creator record 
  11.  r_GetFullRecord = zoho.creator.getRecordById(v_AppOwner,v_AppName,v_ReportName,v_CreatorQuoteID,"joels_creator")
  12.  if(!isnull(r_GetFullRecord.get("data"))) 
  13.  { 
  14.      r_CreatorRecord = r_GetFullRecord.get("data")
  15.      v_CreatorPhotoUrl = ifnull(r_CreatorRecord.get("Display_Photo"),"")
  16.      if(v_CreatorPhotoUrl!="") 
  17.      { 
  18.          // 
  19.          // download photo from your Creator (change connection and check TLD) 
  20.          v_Endpoint1 = "https://creatorapp.zoho.com" + v_CreatorPhotoUrl; 
  21.          r_CreatorPhoto = invokeUrl 
  22.          [ 
  23.              url: v_Endpoint1 
  24.              type: GET 
  25.              connection: "joels_creator" 
  26.          ]
  27.          info r_CreatorPhoto; 
  28.          // 
  29.          // set the param name to file (this is important) 
  30.          r_CreatorPhoto.setParamName("file")
  31.          // 
  32.          // upload the photo to CRM (and prevent workflows from running) 
  33.          v_Endpoint2 = "https://www.zohoapis.com/crm/v2/Products/" + v_CrmProductID + "/photo?restrict_triggers=workflow"
  34.          r_CrmPhoto = invokeurl 
  35.          [ 
  36.              url: v_Endpoint2 
  37.              type: POST 
  38.              files: r_CreatorPhoto 
  39.              connection: "joels_crm" 
  40.          ]
  41.          info r_CrmPhoto; 
  42.      } 
  43.  } 

The above should yield something like:
copyraw
/1234567890123_my_beautiful_face.jpg

{"code":"SUCCESS","details":{},"message":"photo uploaded successfully","status":"success"}
  1.  /1234567890123_my_beautiful_face.jpg 
  2.   
  3.  {"code":"SUCCESS","details":{},"message":"photo uploaded successfully","status":"success"} 

Source(s):
Category: Zoho CRM :: Article: 310

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com