+ Start a Discussion
kodeXkodeX 

Posting to a group

Here,

0FB900000008hoTGAQ is my group id.

(Validity Proof- I could successfully fetch group feed using above group id.)

 

 

To post to a group std Rest api uri syntax is -

https://na1.salesforce.com/services/data/v23.0/chatter/feeds/record/groupId/feed-items?text=new+post

 

Similarly i gave,

https://na1.salesforce.com/services/data/v23.0/chatter/feeds/record/0FB900000008hoTGAQ/feed-items?text=Hello+to+my+group

 

 

Why is it giving Error? -

[{"message":"Parent ID: id value of incorrect type: 0FB900000008hoTGAQ","errorCo
de":"INVALID_FIELD"}]

 

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

ChrisOctagonChrisOctagon

" I could successfully fetch group feed using above group id". What did the URL look like that you successfully used for that? Also, are you trying to post using an http POST?

kodeXkodeX

This was the snippet for fetching group feeds-

 

HttpMethod gm=new GetMethod("the url below"); //Fetch

https://na1.salesforce.com/services/data/v23.0/chatter/chatter/feeds/record/0FB900000008hoTGAQ/feed-items

hclient.execute(gm); //hclient - instance of HttpClient class

System.out.println(gm.getResponseBodyAsString()); //print it

 

Yes Chris, I am trying to post to group using HTTP Post method.

 



ChrisOctagonChrisOctagon

Sorry, the URL looks fine. Are you sure the ID is completely correct?

kodeXkodeX

Yes, i have verified it many times!