Skip to product menu
Skip to main content

Replace image from extension into document

Purpose

To replace the image from extension into the current writer document.

Syntax

WriterClient.dispatch("replaceImage", <image_data_variable>).then(function(response){console.log(response)});

Data Parameters

ParameterData TypeDescription
Mandatory Parameters
srcStringSpecify the url of the new image that needs to be replaced into the document.
idIntegerSpecify the id of the existing image inside the document that needs to be replaced.

Sample data with HTML

Copiedlet data = {
                   "src": "https://images.pexels.com/photos/14866387/pexels-photo-14866387.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
                   "id": "18112746"
                 };
WriterClient.dispatch("replaceImage", data).then(function(response){console.log(response)});

Sample Response

Copied{
 "message": "Object Fetched ",
 "data": {
 "content": {
 "data": {
       "result": 1,
       "response": [
            {
                height: 300,
                id: "88522831",
                src: "https://writer.zoho.com/writer/image.do?imgurl=r-c0hk44e4268dc22474caeacbc065c22385eae-49e39dab4ad14650ba95cc58989560ebef9iax10vfsh&rid=c0hk44e4268dc22474caeacbc065c22385eae",
                width: 300
            }
          ]
        }
      }
   }
}