Yammer tag: id not matching topic ID or name

%3CLINGO-SUB%20id%3D%22lingo-sub-661521%22%20slang%3D%22en-US%22%3EYammer%20tag%3A%20id%20not%20matching%20topic%20ID%20or%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-661521%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20the%20Yammer%20export%20api%20to%20build%20Power%20Bi%20reports.%20Within%20the%20last%20few%20months%20MSFT%20made%20a%20change%20to%20remove%20the%20tag%20name%20from%20the%20inline%20tags%20in%20the%20body%20of%20messages.%20We%20can%20no%20longer%20reference%20these%20as%20we%20are%20using%20the%20tag%20names.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.yammer.com%2Fdocs%2Fdata-export-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.yammer.com%2Fdocs%2Fdata-export-api%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20attached%20the%20old%20and%20new%20format%20images.%20What%20is%20the%20workaround%20now%20to%20use%20these%20tags%20in%20a%20report%20for%20a%20popularity%20trend%3F%3C%2FP%3E%3CP%3EOLD%3C%2FP%3E%3CP%3ENEW%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20229px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F116785iE5568C241AD0C2F7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22OldFormat.jpg%22%20title%3D%22OldFormat.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20187px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F116786iDD88B0DE9B1591AC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22NewFormat.jpg%22%20title%3D%22NewFormat.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-661521%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EYammer%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-871539%22%20slang%3D%22en-US%22%3ERe%3A%20Yammer%20tag%3A%20id%20not%20matching%20topic%20ID%20or%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871539%22%20slang%3D%22en-US%22%3EHi%20Christian%2C%3CBR%20%2F%3E%3CBR%20%2F%3EDid%20you%20find%20a%20way%20to%20link%20the%20messages%20to%20topics%20then%3F%20The%20Export%20topics.csv%20contains%20totally%20different%20IDs...%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-871654%22%20slang%3D%22en-US%22%3ERe%3A%20Yammer%20tag%3A%20id%20not%20matching%20topic%20ID%20or%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871654%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F173052%22%20target%3D%22_blank%22%3E%40Christian%20Luce%3C%2FA%3E%2C%20I%20found%20a%20way%20around%20this.%20Hold%20on.%3C%2FP%3E%3CP%3E%3CSTRONG%3EWhat%20we%20know%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20Yammer%20network%20Export%20ZIP%20file%20contains%20both%20messages.csv%20and%20topics.csv.%3C%2FP%3E%3CP%3EThe%20messages.csv%20contains%20%5B%5Btag%3A%3CTAG_ID%3E%5D%5D%20entries%20inline%20in%20the%20messages.%3C%2FTAG_ID%3E%3C%2FP%3E%3CP%3EThese%20IDs%20do%20%3CSTRONG%3Enot%3C%2FSTRONG%3E%20match%20with%20the%20IDs%20in%20the%20topics.csv%20file.%3C%2FP%3E%3CP%3EThere%20is%20no%20apparent%20relation%20between%20the%20IDs%20in%20the%20messages.csv%20%5B%5Btag%3A%3CTAG_ID%3E%7D%7D%20entries%20and%20the%20topics.csv%20%22id%22%20column.%3C%2FTAG_ID%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EAn%20automated%20workaround%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI've%20tried%20many%20endpoints%20like%20%2Ftopics%2C%20%2Fmessages%2Fabout_topic%2C%20...%20They%20either%20don't%20work%20or%20don't%20return%20anything.%3C%2FP%3E%3CP%3EIn%20the%20end%20I%20resorted%20to%20using%20the%20%2Fsearch.json%3Fquery%3Dtag_name.%3C%2FP%3E%3CP%3EThe%20tag%20names%20can%20be%20found%20in%20the%20topics.csv%20file.%20Just%20iterate%20over%20them%20and%20ask%20the%20search%20api.%20The%20search%20api%20will%20return%20something%20like%20this%3A%3C%2FP%3E%3CPRE%3E%7B%26nbsp%3B%20count%3A%20%7B%20messages%3A%208%2C%20groups%3A%200%2C%20topics%3A%201%2C%20...%20%7D%2C%3CBR%20%2F%3E%26nbsp%3B%20messages%3A%20%7B%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20...%3CBR%20%2F%3E%20%20topics%3A%20%5B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20type%3A%20%22topic%22%2C%3CBR%20%2F%3E%20%20%20%20%20%20id%3A%20657247%2C%3CBR%20%2F%3E%20%20%20%20%20%20name%3A%20%22topic_name%22%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3CBR%20%2F%3E%26nbsp%3B%20%5D%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3CP%3EDon't%20be%20fooled%2C%20this%20ID%20is%20the%20ID%20from%20the%20topics.csv%20and%20hence%20useless.%3C%2FP%3E%3CP%3EBUT%2C%20when%20we%20look%20at%20the%20messages%20object%20in%20the%20search%20results%2C%20we%20get%20a%20%22references%22%20member%20that%20shows%3A%3C%2FP%3E%3CPRE%3Ereferences%3A%20%5B%3CBR%20%2F%3E%20%7B%3CBR%20%2F%3E%20%20%20type%3A%20%22tag%22%2C%3CBR%20%2F%3E%20%20%20id%3A%2054527877%2C%3CBR%20%2F%3E%20%20%20name%3A%20%22tag_name%22%3CBR%20%2F%3E%20%7D%20%3CBR%20%2F%3E%5D%3C%2FPRE%3E%3CP%3E%26nbsp%3BThat%20ID%20%3CSTRONG%3Eis%3C%2FSTRONG%3E%20the%20ID%20that%20is%20found%20in%20the%20messages!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAgreed%2C%20this%20is%20a%20tedious%20workaround%2C%20having%20to%20call%20the%20search%20API%20for%20each%20and%20every%20tag%20in%20topics.csv%2C%20but%20at%20least%20this%20way%20you%20%3CSTRONG%3Ecan%3C%2FSTRONG%3E%20link%20messages%20with%20topics.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps%20anyone%20-%20will%20create%20a%20more%20elaborate%20blogpost%20about%20this%20sometime%20soon.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I am using the Yammer export api to build Power Bi reports. Within the last few months MSFT made a change to remove the tag name from the inline tags in the body of messages. We can no longer reference these as we are using the tag names.

 

https://developer.yammer.com/docs/data-export-api

 

I have attached the old and new format images. What is the workaround now to use these tags in a report for a popularity trend?

OLD

NEWOldFormat.jpg

NewFormat.jpg

2 Replies
Hi Christian,

Did you find a way to link the messages to topics then? The Export topics.csv contains totally different IDs...

Hi @Christian Luce, I found a way around this. Hold on.

What we know

The Yammer network Export ZIP file contains both messages.csv and topics.csv.

The messages.csv contains [[tag:<tag_id>]] entries inline in the messages.

These IDs do not match with the IDs in the topics.csv file.

There is no apparent relation between the IDs in the messages.csv [[tag:<tag_id>}} entries and the topics.csv "id" column.

An automated workaround

I've tried many endpoints like /topics, /messages/about_topic, ... They either don't work or don't return anything.

In the end I resorted to using the /search.json?query=tag_name.

The tag names can be found in the topics.csv file. Just iterate over them and ask the search api. The search api will return something like this:

{  count: { messages: 8, groups: 0, topics: 1, ... },
  messages: {}
    ...
topics: [
    {
type: "topic",
id: 657247,
name: "topic_name"
    }
  ]
}

Don't be fooled, this ID is the ID from the topics.csv and hence useless.

BUT, when we look at the messages object in the search results, we get a "references" member that shows:

references: [
{
type: "tag",
id: 54527877,
name: "tag_name"
}
]

 That ID is the ID that is found in the messages!

 

Agreed, this is a tedious workaround, having to call the search API for each and every tag in topics.csv, but at least this way you can link messages with topics.

 

Hope this helps anyone - will create a more elaborate blogpost about this sometime soon.