You need to sign in to do that
Don't have an account?
Akshay Mourya 6
Feeditem Post
Hi All,
I want to add the feed post using the rest API. I am using python for the same. But while hiting to the rest api its giving me request not found error.
Could you please let me know what is excat issue? Is there any issue with my request body or url/version?
I am attaching the request and url below .
data= {
"body":{
"text":"Test Example"
},
"capabilities":{
"Content":
{"contentDocumentId": "0692y000002KKyhAAG"}
},
"type":"ContentPost",
"feedElementType":"FeedItem",
"parent":"5002y000005rBTWAA2"
}
response = requests.post('https://%s.salesforce.com/services/data/v46.0/sobjects/chatter/feed-elements' % instance,
headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % sessionId },
data = json.dumps(data)
)
print (response.text)
Error Message - {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}
Thanks
I want to add the feed post using the rest API. I am using python for the same. But while hiting to the rest api its giving me request not found error.
Could you please let me know what is excat issue? Is there any issue with my request body or url/version?
I am attaching the request and url below .
data= {
"body":{
"text":"Test Example"
},
"capabilities":{
"Content":
{"contentDocumentId": "0692y000002KKyhAAG"}
},
"type":"ContentPost",
"feedElementType":"FeedItem",
"parent":"5002y000005rBTWAA2"
}
response = requests.post('https://%s.salesforce.com/services/data/v46.0/sobjects/chatter/feed-elements' % instance,
headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer %s' % sessionId },
data = json.dumps(data)
)
print (response.text)
Error Message - {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}
Thanks
Looks like the resource URL is not correct.
Per the documentation https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_feed_element.htm the supported URLs are and Also, the required parameters mentioned in the documentation needs to be passed with the URL.
Note that only the HTTP methods:GET, DELETE, PATCH are supported. POST is not supported.
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you