Share via

Yammer REST API POST https://api.yammer.com/api/v1/messages.json with attachment gives me 500 (Internal Server Error) .

Anonymous
2017-08-23T15:27:47+00:00

<input type="file" #fileInput (change)="onFileChange($event)" accept=".Jpg, .png, .jpg, .jpeg" hidden="true" Multiple ="true"/>

I have written the following piece of code on the onFileChange event in angular 2

let nYamformData:FormData = new FormData();   

nYamformData.append('body','Test' );

nYamformData.append('group_id',12354 );

nYamformData.append('attachment1',fileInput.target.files[i] );

            let headers1 = new Headers({ 'Content-Type': 'multipart/form-data'});

            headers1.append('Authorization', 'Bearer ' + this.ObjUserContext.accesstoken);

            let options = new RequestOptions({ headers: headers1 });

           this.http.post('https://api.yammer.com/api/v1/messages.json',nYamformData,options)

            .subscribe(

         res => {  console.log(res); },  

         err => { console.log(err); }

            )

I am always getting  500 (Internal Server Error) ,

I can successfully post messages (in the Yammer) without an attachment with Content-Type application/json.

Thank you in advance.

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2017-09-01T00:48:58+00:00

    Hello Siva,

    Thank you for your post.

    This is a new feature in Yammer, currently it  may have not rolled out for all the users.

    All Office 365 updates are thoroughly tested and evaluated for performance and scalability before they are released to the public.

    For significant updates, Office customers are initially notified by the Office 365 public roadmap. As an update gets closer to rolling out, it is communicated through your Office 365 Message Center.

    The update is then applied to users who have selected First Release. Once it is determined that the feature is ready for broader release, it's applied to everyone else, including people who have selected Standard Release.

    To receive the latest updates, we request to enable First releases for your account.

    First Release : With this option, you and your users can be the first to see the latest updates and help shape the product by providing early feedback. You can choose to have individuals or the entire organization receive updates early.

    Please refer the Microsoft Article for more information Set up the Standard or First Release options in Office 365

    Regards,

    Sushil Dhiwa.

    Microsoft Yammer support team.

    Was this answer helpful?

    0 comments No comments