2

I am facing some problem with retrieving the images from Salesforce fields.

I am trying to follow this link, but I am not able to get the binary form of the image.

Following is how my data looks:

{
  "attributes": {
      "type": "lord",
      "url": "/services/data/v42.0/sobjects/lord/000000GrWZAA0"
  },
  "Id": "000000GrWZAA0",
  "Solution__c": "<img alt=\"User-added image\" height=\"187\" src=\"https://company--d.na6.content.force.com/servlet/rtaImage?eid=ka380033330GrWZ&amp;feoid=00N82222205DIbz&amp;refid=0EM45430000kCBr\" width=\"500\"></img>"
}

So referrring the link , I created a GET request as mentioned in the Salesforce documentation:

https://company.my.salesforce.com/services/data/v42.0/sobjects/lord/000000GrWZAA0/richTextImageFields/Solution__c/0EM45430000kCBr/body

with header:

Authorization: Bearer token

After making a request, I get the following error:

[
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
]

Can someone please throw some light on what am I missing. everything looks good to me, but I am guessing I am missing some silly thing in this easy piece of code.

Also, I have looked upon many other threads about accessing, but since I am using NodeJS (REST API), I am not finiding the best solution that I can proceed with. The one I am referring is the above one which I am stuck at.

It would be great if someone can help me with this or maybe direct me towards an other way to access this image link to public. I am using: NodeJS, and NPM Module JSFORCE for my implementation.

TIA

1
  • Hi @RDoonds, I am facing the same issue, have you resolved this? please let me know
    – rams0610
    Jun 14, 2019 at 13:42

1 Answer 1

0

Could you please try changing the version from 42.0 to 43.0 and also remove the '/body' part from the request. I think that should work.

https://company.my.salesforce.com/services/data/v43.0/sobjects/lord/000000GrWZAA0/richTextImageFields/Solution__c/0EM45430000kCBr
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.