The Objective of this article is to share how can a developer extract the image from the Richtext field on any object using REST API

How to do it

There are 4steps to it

  1. Create an object / use any existing one e.g say Knowledge standard object
  2. Create a new RichText type field named Details
  3. Get ready with your Postman and call the GET sObject request
  • endpoint :/services/data/v55.0/sobjects/knowledge__kav/ka15e0000011oBYAAY (where “ka15e0000011oBYAAY” is my record Id)
  • response: FAQ_Answer__c”: “<img alt=\”Screenshot 2022–08–09 at 14.15.51.png\” src=\”;feoid=00N5e00000TbmXY&amp;refid=0EM5e000001q21x\"></img>"

4. copy the “ref Id” from the response from the respective richtext field shown in the response and prepare to make another Get call to the following resource :

  • GET: /services/data/v55.0/sobjects/knowledge__kav/ka15e0000011oBYAAY/richTextImageFields/FAQ_Answer__c/0EM5e000001q21x