So I've created a custom object and added the Notes to available related lists on the page layout. Now I want to manage notes through the REST API.
The problem is, I have no idea how to access the notes. I found a suggestion that AttachedContentNote
is a wrapper around ContentNote
, and that seems to be supported by the fact that I can see my note under services/data/v43.0/sobjects/ContentNote/listviews/00B2v00000Osr6REAR/results
, but that doesn't link it to the custom object records, which is what I assume AttachedContentNote
does.
The problem is that I can't seem to find the AttachedContentNote
object. I've looked at AttachedContentNote docs and it indicates that there is a LinkedEntityId
field, but using this in a query (e.g. services/data/v43.0/sobjects/AttachedContentNote/LinkedEntityId/00B2v00000Osr6R
) tells me that the field doesn't exist or isn't accessible (the access token belongs to the system administrator user, so I assume it doesn't exist).
On further reading, I've noticed that the documentation for AttachedContentNode states the following, which doesn't clear up how to actually access the notes:
To retrieve ContentNote objects, issue a describe call on an object, which returns a query result for each note created or attached. You can’t directly query this object.
How do I list and access notes belonging to a given entity? If I have custom object id X, how do I find, create, and update, etc. content note Y using REST?
ContentDocument
withFileType
asSNOTE
. So you can use SOQL againstContentDocumentLink
with related query toContentDocument
fields.