0

I am trying to access the content from the contentnote object. I queried ContentDocumentLink where i passed account id as LinkedEntityId and got the ContentDocumentId. Using ContentDocumentId, I queried the ContentNote. I am able to get the title, created date, created by, textpreview, and content.

For, content I am getting an url like this:

/services/data/v42.0/sobjects/ContentNote/0693s00000JBRj6AAH/Content

If I use the same ContentNote soql query in workbench or talend using salesforce object, I am able to get the coded notes message. But this is not same when I use simple-salesforce to query ContentNote.

I then use the simple_Salesforce object to get the note's content like this -

sf.ContentNote.get("0693s00000JBRj6AAH/Content")

this gives:

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I tried json.loads or json.dumps but no way I am able to remove the JSONDecodeError error.

Is there any other way to solve the problem? Am I retrieving the notes from ContentNote correctly??

0

1 Answer 1

0

Best guess (as I haven't used this code) from looking at the documentation such as Record Management:

# Returns all fields including the Content one as a dictionary
contentNote = sf.ContentNote.get('0693s00000JBRj6AAH')

# Content is base64 so will need to be decoded
contentInBase64 = contentNote["Content"];

If you are sure you are following the documentation and have invested several hours in trying to make this work and you still hit a problem, consider raising an issue here http://github.com/simple-salesforce/simple-salesforce/issues. While there hasn't been an update for several months, issues do seem to generate discussion.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .