Get api/v1/messages.json ommits 40% of messages

%3CLINGO-SUB%20id%3D%22lingo-sub-77432%22%20slang%3D%22en-US%22%3EGet%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77432%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWhen%20I%20compare%20the%20data%20returned%20by%20get%20api%2Fv1%2Fmessages.json%20to%20the%20data%20retrieved%20using%20the%20export%20in%20yammer.%20get%20api%2Fv1%2Fmessages.json%20returns%206%2C300%20records.%20The%20data%20export%20returns%2010%2C469%20records.%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20get%20my%20incomplete%206%2C300%20rows%20I...%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B1.%20Use%20the%20export%20API%20to%20get%20a%20list%20of%20all%20of%20the%20groups%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B2.%20Loop%20through%20that%20list%20of%20groups%20and%20download%20the%20messages%20for%20each%20group%20using%20%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages%2Fin_group%2F%3Agroup_id.json%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages%2Fin_group%2F%3Agroup_id.json%3C%2FA%3E%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B3.%20Then%20I%20use%20%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages.json%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.yammer.com%2Fapi%2Fv1%2Fmessages.json%3C%2FA%3E%20with%20the%20older_than%20parameter%20to%20get%20all%20of%20the%20messages%20in%20the%20All%20Company%20feed.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20appears%20to%20be%20with%20step%203.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20would%20appreciate%20any%20insight%20on%20what%20the%20issue%20might%20be%20with%20the%20get%20api%2Fv1%2Fmessages.json%20API%20endpoint%2C%20and%20how%20I%20might%20modify%20my%20code%20to%20resolve%20this%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-77432%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%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-78565%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78565%22%20slang%3D%22en-US%22%3E%3CP%3EWow%2C%20by%20design%3F%20%26nbsp%3BWhat%20is%20the%20design%20goal%3F%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78519%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78519%22%20slang%3D%22en-US%22%3E%3CP%3EMicrosoft%20phone%20support%20recognized%20this%20as%20a%20known%20issue%2C%20and%20said%20that%20v2%20of%20the%20API%20resolves%20this%20issue.%20%26nbsp%3B%20But%2C%20they%20were%20unable%20to%20provide%20an%20estimated%20release%20date%20for%20v2%20of%20the%20API.%20%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESeparately%2C%20I%20had%20a%20Yammer%20support%20tech%20reach%20out%20to%20me%20on%20%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F44523121%2Fyammer-api-get-messages-json-returns-incomplete-results%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Estackoverflow%3C%2FA%3E%26nbsp%3Band%20reply%20similarly%20that%20omitting%20portions%20of%20the%20data%20was%20an%20intended%20result%20by%20design.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78240%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78240%22%20slang%3D%22en-US%22%3E%3CP%3EMake%20sure%20your%20date%20is%20properly%20early%20-%20I%20use%20like%201980%20to%20make%20sure%20all%20my%20data%20is%20there.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20you%20have%20your%20network%20configured%20for%20hard%20delete%2C%20which%20would%20REALLY%20delete%20any%20messages%20deleted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20the%20API%20executing%20as%20a%20verified%20admin%20with%20private%20content%20mode%20turned%20on%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77532%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77532%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20response%20Tom%20K.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20had%20zero%26nbsp%3Bdeleted%20posts%20in%20the%20export%20(which%20is%20odd%20b%2Fc%20I%20have%20deleted%20posts%20from%20yammer...I%20guess%20they're%20not%20included%20in%20the%20export).%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20removing%20private%20messages%20I%20had%209%2C860%20posts%20in%20the%20yammer%20export.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20API%20download%20does%20include%20posts%20from%20private%20groups.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-77508%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20api%2Fv1%2Fmessages.json%20ommits%2040%25%20of%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-77508%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20your%20export%2C%26nbsp%3Bdo%20a%20sort%20by%20deleted_at%20date%2C%20and%20then%20do%20a%20secondary%26nbsp%3Bsort%20by%20suspended_at%20date.%20%26nbsp%3BThen%2C%20count%20how%20many%20rows%20have%20data%20in%20either%20of%20those%20columns%2C%20vs.%20how%20many%20rows%20have%20null%20in%20those%20columns.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20you've%20done%20that%2C%20do%20a%20tertiary%20sort%20by%20in_private_conversation%2C%20and%20separate%20those%20which%20are%20listed%20as%20TRUE.%20%26nbsp%3BThese%20are%20PMs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20hoping%20this%20finds%20your%20issue%20-%20exports%20will%20include%20deleted%20data%2C%20and%20the%20messages.json%20won't.%20%26nbsp%3BAnd%2C%20of%20course%2C%20you%20won't%20find%20private%20messages%20through%20querying%20groups%20either.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%2C%20you'll%20need%20the%20token%20you're%20using%20for%20the%20messages.json%20to%20be%20a%20verified%20admin%20set%20in%20Private%20Content%20Mode%20(not%20the%20default)%20in%20order%20to%20get%20the%20messages%20in%20private%20groups.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20us%20know%20what%20you%20find.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

When I compare the data returned by get api/v1/messages.json to the data retrieved using the export in yammer. get api/v1/messages.json returns 6,300 records. The data export returns 10,469 records.

To get my incomplete 6,300 rows I...
   1. Use the export API to get a list of all of the groups
   2. Loop through that list of groups and download the messages for each group using https://www.yammer.com/api/v1/messages/in_group/:group_id.json
   3. Then I use https://www.yammer.com/api/v1/messages.json with the older_than parameter to get all of the messages in the All Company feed.

 

The issue appears to be with step 3.

I would appreciate any insight on what the issue might be with the get api/v1/messages.json API endpoint, and how I might modify my code to resolve this issue.

5 Replies

In your export, do a sort by deleted_at date, and then do a secondary sort by suspended_at date.  Then, count how many rows have data in either of those columns, vs. how many rows have null in those columns.

 

Once you've done that, do a tertiary sort by in_private_conversation, and separate those which are listed as TRUE.  These are PMs.

 

I'm hoping this finds your issue - exports will include deleted data, and the messages.json won't.  And, of course, you won't find private messages through querying groups either.  

 

Finally, you'll need the token you're using for the messages.json to be a verified admin set in Private Content Mode (not the default) in order to get the messages in private groups.

 

Please let us know what you find. 

 

 

Thanks for your response Tom K.

I had zero deleted posts in the export (which is odd b/c I have deleted posts from yammer...I guess they're not included in the export).

After removing private messages I had 9,860 posts in the yammer export.

 

My API download does include posts from private groups.

Make sure your date is properly early - I use like 1980 to make sure all my data is there.

 

Maybe you have your network configured for hard delete, which would REALLY delete any messages deleted.

 

Is the API executing as a verified admin with private content mode turned on?

Microsoft phone support recognized this as a known issue, and said that v2 of the API resolves this issue.   But, they were unable to provide an estimated release date for v2 of the API.  

Separately, I had a Yammer support tech reach out to me on stackoverflow and reply similarly that omitting portions of the data was an intended result by design.

Wow, by design?  What is the design goal?