Yammer data export - how to automate to run daily

Occasional Contributor

Require assistance to script and schedule a Yammer data export (excluding attachments) to run daily, in an unzipped format. Also if its possible, to save the exported data directly into an Azure store (for Machine Learning processing).

 

Any suggestions, or methods already being used to achieve this?

 

Came across this information on the Yammer data export api:

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

However I'm not a developer ie. Unsure how to correctly code, setup and execute something like this...

 

Thanks

8 Replies
Can I ask what the purpose is of exporting the content on a daily basis?

@Loryan Strant its a requirement from our machine learning lab...I believe they need to have the latest data set and to track changes/variances   

I run a powershell script.... scheduled to run every day. Make sure whereever you're hosting has access as well as Powershell Version 4 or newer (I use 5 currently). Check powershell version with $PSVersionTable.PSVersion.

 

Follow instructions on that site to get your token, then fill it in the bearer token below...

Use at your own risk. You need to build out error handling and logging. Also, directory checks for items that already exist/move items if you want to archive previous exports. GL.

 

$BearerToken = ''

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Bearer $BearerToken")
$headers.Add("Accept",'*/*')
$headers.Add("accept-encoding", "zip")

#Base Directory where you want these files to be saved locally

$dir = ''
$currentfile = "$($dir)\current\messages.csv"

# You can use a relative date range for the export as well, by building out a date object

$export = "https://www.yammer.com/api/v1/export?since=2015-01-01T00:00:00&include=csv"

#Create logs for your files.

$log_file = "$($dir)\log\{0:yyyy-MM}_Export.log" -f (get-date)
#Example to add logs -- $logmsg = "This is my log"

# Add-content $log_file "$logmsg"

#Two lines inside the Try is actually where the attempts work. I found there to be issues so I put them in different areas for download, then download is complete, unzip.

 


Try
    {

     invoke-webrequest -uri $export -method get -headers $headers -OutFile $dir\export.zip  }

     Expand-archive -path $dir\export.zip  -dest $dir\current -f

Catch

{

#Error Handling goes here

}

It may be more cost effective and impactful for your organization in the long run to use a 3rd party tool designed to do this and much more. They've spent the time to learn how best to extract all the data possible from Yammer. For your specific use case, I'd highly recommend tyGraph. @Dean Swann

I'm not quite sure if you can extract any more information than the export provides. I built out a pretty robust dashboard in Tableau based off the export, which costs my organization $0 to maintain now as it's in an automated state. 

 

Yes, tygraph has more at the moment, but I can build out any of those dashboards in a day - but there's been no requirement for me to do so internally. The thing we lack most is the ability to view lurkers. (See people who just sign in to read messages) - As well as what they're viewing, but there's no API for that so I assume there's no solution that includes that.

 

 

Congrats on automating that! It's a shame you're not seeing the demand for those analytics that I see elsewhere. I'd suggest driving a conversation with management about their business goals for the platform: are they looking to drive more innovation? improve execution? When usage is driven by a business goal, there's much more interest in the data showing improvement toward that goal.

 

Yes, there's no API for thread "reads" but tyGraph has found a way to mine file views and downloads. They and others also analyze replies and mentions for a clearer picture of who the influencers are in your organization. Also, there was this announced today by the Yammer team at Ignite (note the "read" counts).

 

Group AnalyticsGroup Analytics

 

 

 

 

Yea, the read counts are already available in O365 admin analytics reporting board. You can download views per person and per thread, but you can't isolate who is viewing what. It's an aggregation graph you really can't do much with and there's still no API despite it's getting a read count somehow. I want to be able to report on what threads are getting the most views and the unique count of views etc to do analytics behind it.
You're actually getting views per person and per *group*, but you're right - there's no way to get read information at the thread level. We have one workaround for this. If you include a GIF in the original post, tyGraph has figured out how to get the number of "file views" on a file, which is incremented whenever someone views a GIF in a thread. Aside from that, I'd have a conversation with your stakeholders about using a different metric like replies or likes. It will certainly be a smaller number, but it's potentially a more potent measure of actual value of the thread.