Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
Retrieve image form Salesforce API for rich text field

I am using this API to retrieve an image from SF and show it in img tag

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_rich_text_image_retrieve.htm

I am using axios to send a get request like this

const headers = {
  Authorization: `Bearer ${token}`,
  responseType: 'arraybuffer',
};

const url =
  'https://saas-force.salesforce.com/services/data/v50.0/sobjects/objectName__c/a0K1X000004Z8lI/richTextImageFields/Rich_Text_Field_Name__c/0EM1X000000MFDu';

const response = await axios.get(url, { headers });

img.setAttribute('src', `data:image/jpg;base64,${response.data}`);

The response looks like this once I log it in console enter image description here

and from network enter image description here

But the image is always showing as corrupted in html enter image description here

it seems that there should be a different ways to deal with this type of response, I tried many approaches, but still didn't successed

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda