How to send announcement in yammer through api i tried below but its not working

%3CLINGO-SUB%20id%3D%22lingo-sub-213018%22%20slang%3D%22en-US%22%3EHow%20to%20send%20announcement%20in%20yammer%20through%20api%20i%20tried%20below%20but%20its%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-213018%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20to%20send%20announcement%20in%20yammer%20through%20api%20i%20tried%20below%20but%20its%20not%20working.Giving%20some%20security%20state%3A0%20error.Even%20though%20i%20selected%20log%20in%20before%20posting.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eurl%3A%20%22messages.json%22%3CBR%20%2F%3E%2Cheaders%3A%20%7B'Authorization'%3A%20'Bearer%20GGFFBBB-88966333'%20%7D%3CBR%20%2F%3E%2C%20method%3A%20%22POST%22%3CBR%20%2F%3E%2C%20data%3A%20%7B%3CBR%20%2F%3E%22body%22%3A%20%22Msg%22%2C%3CBR%20%2F%3E%22log_data%5Bpublisher_type%5D%22%3A%20%22yam.ui.publisher.global.AnnouncementPublisher%22%2C%3CBR%20%2F%3E%22log_data%5Bpublisher_source%5D%22%3A%20%22group%22%2C%3CBR%20%2F%3E%22log_data%5Bnumber_of_recipients%5D%22%3A%20%221%22%2C%3CBR%20%2F%3E%22invited_user_ids%22%3A%20%22%22%2C%3CBR%20%2F%3E%22skip_body_notifications%22%3A%20%22true%22%2C%3CBR%20%2F%3E%22group_id%22%3A%2244556699%22%2C%3CBR%20%2F%3E%22is_rich_text%22%3A%20%22true%22%2C%3CBR%20%2F%3E%22message_type%22%3A%20%22announcement%22%2C%3CBR%20%2F%3E%22title%22%3A%20%22Title%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%20success%3A%20function%20(msg)%20%7B%20alert(%22Post%20was%20Successful!%22)%3B%20%7D%3CBR%20%2F%3E%2C%20error%3A%20function%20(msg)%20%7B%20alert(%22Error%22%2BJSON.stringify(msg))%3B%20%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-213018%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EREST%20API%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYammer%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-213358%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20send%20announcement%20in%20yammer%20through%20api%20i%20tried%20below%20but%20its%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-213358%22%20slang%3D%22en-US%22%3E%3CP%3ECouple%20of%20things%20to%20check%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EThe%20account%20you%20are%20posting%20with%20has%20the%20ability%20to%20post%20Announcements.%20(I%20know%20perhaps%20a%20daft%20question)%3C%2FLI%3E%0A%3CLI%3EThe%20body%20of%20the%20message%20is%20formatted%20using%20HTML%3C%2FLI%3E%0A%3CLI%3ECan%20you%20post%20a%20message%20to%20the%20group%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20POST%20will%20look%20something%20like%20(for%20speed%20I've%20used%20the%20Flow%20so%20its%20added%20in%20a%20couple%20of%20extras)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%5B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E1120667167%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22sender_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E1512434534%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22replied_to_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3Enull%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22created_at%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%222018%2F07%2F09%26nbsp%3B14%3A41%3A44%26nbsp%3B%2B0000%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22network_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E41253%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22message_type%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22announcement%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22sender_type%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22user%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22url%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages%2F1120667167%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages%2F1120667167%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22web_url%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Ftenantname%2Fmessages%2F11206%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yammer.com%2Ftenantname%2Fmessages%2F11206%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E67167%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22group_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E4191007%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22title%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Testing%26nbsp%3B(ignore)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22body%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22parsed%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Testing%26nbsp%3Bposting%26nbsp%3Bfrom%26nbsp%3BFlow%26nbsp%3Bwith%26nbsp%3Bsome%26nbsp%3Bhtml%5Cn%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22plain%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Testing%26nbsp%3Bposting%26nbsp%3Bfrom%26nbsp%3BFlow%26nbsp%3Bwith%26nbsp%3Bsome%26nbsp%3Bhtml%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22rich%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Testing%26nbsp%3Bposting%26nbsp%3Bfrom%26nbsp%3BFlow%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewith%26nbsp%3Bsome%26nbsp%3Bhtml%3C%2FP%3E%22%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22thread_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E1120667167%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22client_type%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Microsoft%26nbsp%3BPowerApps%26nbsp%3Band%26nbsp%3BFlow%26nbsp%3B(Europe)%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22client_url%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22%3CA%20href%3D%22http%3A%2F%2Fwww.powerapps.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.powerapps.com%3C%2FA%3E%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22system_message%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3Efalse%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22direct_message%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3Efalse%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22chat_client_sequence%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3Enull%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22language%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3Enull%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22notified_user_ids%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%5B%5D%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22privacy%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22public%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22attachments%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%5B%5D%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22liked_by%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22count%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E0%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22names%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%5B%5D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22content_excerpt%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Testing%26nbsp%3Bposting%26nbsp%3Bfrom%26nbsp%3BFlow%26nbsp%3Bwith%26nbsp%3Bsome%26nbsp%3Bhtml%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22group_created_id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk7%22%3E4191007%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%5D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

How to send announcement in yammer through api i tried below but its not working.Giving some security state:0 error.Even though i selected log in before posting.

 

url: "messages.json"
,headers: {'Authorization': 'Bearer GGFFBBB-88966333' }
, method: "POST"
, data: {
"body": "Msg",
"log_data[publisher_type]": "yam.ui.publisher.global.AnnouncementPublisher",
"log_data[publisher_source]": "group",
"log_data[number_of_recipients]": "1",
"invited_user_ids": "",
"skip_body_notifications": "true",
"group_id":"44556699",
"is_rich_text": "true",
"message_type": "announcement",
"title": "Title"
}
, success: function (msg) { alert("Post was Successful!"); }
, error: function (msg) { alert("Error"+JSON.stringify(msg)); }

1 Reply

Couple of things to check:

 

  1. The account you are posting with has the ability to post Announcements. (I know perhaps a daft question)
  2. The body of the message is formatted using HTML
  3. Can you post a message to the group?

 

The POST will look something like (for speed I've used the Flow so its added in a couple of extras):

 

[
  {
    "id"1120667167,
    "sender_id"1512434534,
    "replied_to_id"null,
    "created_at""2018/07/09 14:41:44 +0000",
    "network_id"41253,
    "message_type""announcement",
    "sender_type""user",
    "url""https://www.yammer.com/api/v1/messages/1120667167",
    "web_url""https://www.yammer.com/tenantname/messages/1120667167",
    "group_id"4191007,
    "title""Testing (ignore)",
    "body": {
      "parsed""Testing posting from Flow with some html\n",
      "plain""Testing posting from Flow with some html",
      "rich""Testing posting from Flow <p>with some html</p>"
    },
    "thread_id"1120667167,
    "client_type""Microsoft PowerApps and Flow (Europe)",
    "client_url""http://www.powerapps.com",
    "system_message"false,
    "direct_message"false,
    "chat_client_sequence"null,
    "language"null,
    "notified_user_ids": [],
    "privacy""public",
    "attachments": [],
    "liked_by": {
      "count"0,
      "names": []
    },
    "content_excerpt""Testing posting from Flow with some html",
    "group_created_id"4191007
  }
]