You need to sign in to do that
Don't have an account?
Akshay Mourya
Feed attachment api
Hi All,
I want to post a feed with attachment using rest api but its giving me resource not found error.
Please find the below code.
data= {
"body":{
"messageSegments":[
{
"type":"Text",
"text":"Please take a look at these files."
}
]
},
"attachment":"content",
"capabilities":{
"files":{
"items": [
{"id": "00P2y000006yGY8EAM"}
]
}
},
"subjectId":"5002y000006UlPKAA0",
"feedElementType":"FeedItem",
"type":"ContentPost"
}
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)
)
Can you please let me know what is the issue?
Thanks
I want to post a feed with attachment using rest api but its giving me resource not found error.
Please find the below code.
data= {
"body":{
"messageSegments":[
{
"type":"Text",
"text":"Please take a look at these files."
}
]
},
"attachment":"content",
"capabilities":{
"files":{
"items": [
{"id": "00P2y000006yGY8EAM"}
]
}
},
"subjectId":"5002y000006UlPKAA0",
"feedElementType":"FeedItem",
"type":"ContentPost"
}
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)
)
Can you please let me know what is the issue?
Thanks
Anudeep (Salesforce Developers)
Can you try with a simple example and confirm if it returns results?