{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/export","auth":"required","params":[{"name":"Users","type":"mixed","default":"","desc":"Get users data","required":false,"in":"body","ref":"","_id":"547395b7007eb108007e043f"},{"name":"Group","type":"int","default":"","desc":"Get group data","required":false,"in":"body","ref":"","_id":"547395b7007eb108007e043e"},{"name":"Message","type":"int","default":"","desc":"Get message data","required":false,"in":"body","ref":"","_id":"547395b7007eb108007e043d"}],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Network Data Export","type":"basic","slug":"export","excerpt":"","body":"[block:api-header]\n{\n  \"title\": \"Introduction\"\n}\n[/block]\nYammer Data Export will package and export **all **messages (including previous versions), Files stored in Yammer, topics, users, and groups. Data will be exported into a zip file containing .csv files for messages (including previous versions) and additional archives containing Files. \n\nPerform a one-time export simply by specifying the starting date from which you would like to export and the end date to which you would like to export. Alternatively, you can also set up recurring exports on a daily or weekly basis per your business needs.\n\n**Highlights**\n\n  * Comprehensive Data Export: Export all the data on your network, including messages (including previous versions), Files, topics, users, and groups. Note: We recommend downloading data with files by using a one-day range, to reduce the likelihood of errors caused by an unreliable data connection. If there are a lot of files on the specified day, we recommend exporting by using a one-hour range.\n\n  * Data Export API: Utilize the Data Export API to set up and customize automatic, recurring exports for your network. The API provides more control, flexibility, and customization for IT admins.\n\n  * Simplified One-Time Exports: Simply specify a starting date to have all of your network data from that starting point exported.\n\n  * For the network on which the external group \"lives\", export all content in that group.\n\n  * For the external user that is a group member, VAs only receive threads that the external user explicitly participated in (posted a message to). If there is a message in the group that the user did not participate in, it will not be available in the data export.\n\nData Exports can also be performed by visiting Network Admin > Content and Security > Export Data.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2a81b57-Data_Export.png\",\n        \"Data Export.png\",\n        1642,\n        1132,\n        \"#333\"\n      ],\n      \"caption\": \"Yammer Data Export in the Network Admin Center\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Authorization\"\n}\n[/block]\nThe Data Export API can only be used by **Yammer Verified Administrators**. An OAuth 2 access token belonging to a **verified admin** must be used and set as a “Bearer” token in the “Authorization” request header.\n\nThe Data Export API supports using both the legacy Yammer OAuth 2 token and Azure Active Directory tokens acquired using MSAL. Learn more about supported authentication types [here](https://developer.yammer.com/docs/oauth-2).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /api/v1/messages/following.json HTTP/1.1 \\nHost: www.yammer.com \\nAuthorization: Bearer abcDefGhi\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nFor more detail on the “Bearer” token refer to: http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23\n\nIf the access token expires, or the user de-authorizes your app, the API request will return an HTTP 401 with the following error in the body of the response.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"response\\\": {\\n    \\\"message\\\": \\\"Token not found.\\\",\\n    \\\"code\\\": 16,\\n    \\\"stat\\\": \\\"fail\\\"\\n  }\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"How this API works\"\n}\n[/block]\nThis API is synchronous - an HTTP request is made to the API and content is returned in the requested format.\n\n**Example Queries** \n  * Export all data since February 9, 2020: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n  * Export all data since February 9, 2020, and until March 10th, 2021:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00&until=2021-03-10T00:00:00+00:00\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n  * Export all data since February 9, 2020 but exclude file attachments:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00&include=csv\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n  * Export message data since February 9, 2020, and exclude file attachments:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://export.yammer.com/api/v1/export?since=2020-02-9T00:00:00+00:00&model=Message&include=csv\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n**Query Parameters:**\n\n- **model** - Indicates which models to be exported. All available models will be exported if no model is specified. Multiple models may be specified with multiple parameters with the 'model' name. Available models include:\n\n  * User\n  \n  * Group\n  \n  * Message\n\n  * MessageVersion  \n \n  * Topic\n\n *  Tags\n  \n  * UploadedFileVersion\n\n- **since** - (Required parameter) -  Indicates the start date of the export. All exported changes will have occurred on or after this date. Must be encoded as an ISO-8601 date. \n\n- **until** -  Indicates the end date of the export. All exported changes will have occurred on or before this date (Note: Since export is looking at the until date at 00:00 GMT, use until today+1 if you cannot see the models created on the day of the export). If you're planning on a very large export, use \"until\" to break up the export into manageable pieces (data exports of a very large size may fail). Must be encoded as an ISO- 8601 date. If this value is not provided, until defaults to the current date.\n\n- **include** – Defines whether to include file attachments or not. Options are ‘csv’ (no attachments) or ‘all’ (include attachments).\n\n- **network** – Which network(s) one wishes to export. Must be accessible using the provided OAuth bearer token. i.e. the network \nassociated with the token, or associated external networks.\n\n- **include_ens** – If ‘true’, automatically include all external networks associated with the network associated with the OAuth bearer token. \n\nEnsure that the parameters are correctly URL encoded before executing the request to the Data Export API. Some tools will handle this automatically, but you should check this when troubleshooting.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Response\"\n}\n[/block]\nThe response is an application/zip (ZIP file) payload encapsulating the contents of the data export. Internally, the ZIP file will contain the following files and directories for a complete export:\n\n  *  Users.csv\n  \n  *  Groups.csv\n  \n  *  Messages.csv\n    \n  *  MessageVersions.csv  \n\n  *  Topics.csv\n\n  *  Tags.csv\n  \n  *  Files.csv\n  \n  *  files\n \n  *  Admins.csv\n  \n  *  Networks.csv\n\n  * log.txt\n\n  * request.txt \n\n\n  * Messages.csv vs MessageVersions.csv\nMessage export follows these two criteria:\n  * 1- Exports only versions that fall in the time search range\n  * 2- If a message is the latest version, it will appear in both Messages.csv and \n\n  * MessageVersions.csv.  \nThis means, if the latest version of a message is in the time range, it will be exported in both Messages.csv and MessageVersions.csv; any older version within the time range will only be exported in MessageVersions.csv.\n[block:api-header]\n{\n  \"title\": \"Response CSV Files Contents\"\n}\n[/block]\nThe following fields are exported in CSVs in the Data Export API.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Users.csv\",\n    \"h-1\": \"Groups.csv\",\n    \"h-2\": \"Messages and MessageVersions.csv\",\n    \"0-0\": \"id\\nname\\nemail\\njob_title\\nlocation\\ndepartment\\napi_url\\ndeleted_by_id\\ndeleted_by_type\\njoined_at\\ndeleted_at\\nsuspended_by_id\\nsuspended_by_type\\nguid\\nstate\\noffice_user_id\",\n    \"0-1\": \"id\\nname\\ndescription\\nprivate\\nmoderated\\napi_url\\ncreated_by_id\\ncreated_by_type\\ncreated_at\\nupdated_at\\ndeleted\\nexternal\\ncover_image\\noffice_group_id\",\n    \"0-2\": \"id\\nreplied_to_id\\nthread_id\\nconversation_id\\ngroup_id\\ngroup_name\\nparticipants\\nin_private_group\\nin_private_conversation\\nsender_id\\nsender_type\\nsender_email\\nbody\\napi_url\\nattachments*\\ndeleted_by_id\\ndeleted_by_type\\ncreated_at\\ndeleted_at\\ntitle\\nhtml_body\\nmessage_type\\ngdpr_delete_url\",\n    \"h-3\": \"Topics.csv\",\n    \"0-3\": \"id\\nname\\ncreated_by\\ncreated_at\\napi_url\\ndescription\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Files.csv\",\n    \"0-0\": \"id\\nfile_id\\nname\\ndescription\\nuploader_id\\ngroup_id\\ngroup_name\\nreverted_to_id\\ndeleted_by_user_id\\nin_private_group\\nin_private_conversation\\nfile_api_url\\ndownload_url\\npath\\nuploaded_at\\ndeleted_at\\nstorage_type\",\n    \"h-1\": \"Tags.csv\",\n    \"0-1\": \"id\\nname\",\n    \"h-2\": \"Admin.csv\",\n    \"0-2\": \"id\\nname\\nemail\\nverified\",\n    \"h-3\": \"Networks.csv\",\n    \"0-3\": \"id\\npermalink\\nname\\nurl\\npaid\\ncreated_at\\nmoderated\\nusage_policy\\nnumber_of_users\\nsecure_browser_token\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n*****Along with attachments this OGO information is now exported: id, url, title, description. \n\n**Potential Failure**\n\nIf there are errors exporting any data, the data export will be a partial export. In this case, the log.txt will contain details of what failed to export.  The best way to avoid partial failures is to export smaller timeframes at a time. Large data exports are more likely to fail.\n\nA Sample Code using the API in Unix and Windows PowerShell is provided [here](https://developer.yammer.com/v1.0/docs/code-samples). This Sample Code is provided for the purpose of illustration only and is not intended to be used as-is in a production environment.","updates":[],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"605d6cdd8ab236000f34d358","createdAt":"2021-03-26T05:10:53.884Z","user":"5cd352a0d05b5a000f225f36","category":{"sync":{"isSync":false,"url":""},"pages":["547391bf007eb108007e042c"],"title":"Data Export","slug":"data-export-api","order":5,"from_sync":false,"reference":false,"_id":"546ced235884600e007a92f6","__v":1,"project":"545137a814af501a00b50cf9","createdAt":"2014-11-19T19:18:59.863Z","version":"545137a814af501a00b50cfc"},"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["545137a814af501a00b50cfd","545138eaa66f020800dbab4a","546b9072b47b5d1400109edf","546b9082b47b5d1400109ee0","546b9088b47b5d1400109ee1","546b909462515a14007ebc43","546b90a0b47b5d1400109ee2","546ced235884600e007a92f6","5481008eea7fd40b00cd7c2b","573b9d83ee2b3b220042291f","57be1efa15efc70e006a5f99","5ee004f52c97b4004c7a5876"],"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":12,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z"},"project":"545137a814af501a00b50cf9","__v":24,"parentDoc":null}

Network Data Export


[block:api-header] { "title": "Introduction" } [/block] Yammer Data Export will package and export **all **messages (including previous versions), Files stored in Yammer, topics, users, and groups. Data will be exported into a zip file containing .csv files for messages (including previous versions) and additional archives containing Files. Perform a one-time export simply by specifying the starting date from which you would like to export and the end date to which you would like to export. Alternatively, you can also set up recurring exports on a daily or weekly basis per your business needs. **Highlights** * Comprehensive Data Export: Export all the data on your network, including messages (including previous versions), Files, topics, users, and groups. Note: We recommend downloading data with files by using a one-day range, to reduce the likelihood of errors caused by an unreliable data connection. If there are a lot of files on the specified day, we recommend exporting by using a one-hour range. * Data Export API: Utilize the Data Export API to set up and customize automatic, recurring exports for your network. The API provides more control, flexibility, and customization for IT admins. * Simplified One-Time Exports: Simply specify a starting date to have all of your network data from that starting point exported. * For the network on which the external group "lives", export all content in that group. * For the external user that is a group member, VAs only receive threads that the external user explicitly participated in (posted a message to). If there is a message in the group that the user did not participate in, it will not be available in the data export. Data Exports can also be performed by visiting Network Admin > Content and Security > Export Data. [block:image] { "images": [ { "image": [ "https://files.readme.io/2a81b57-Data_Export.png", "Data Export.png", 1642, 1132, "#333" ], "caption": "Yammer Data Export in the Network Admin Center" } ] } [/block] [block:api-header] { "title": "Authorization" } [/block] The Data Export API can only be used by **Yammer Verified Administrators**. An OAuth 2 access token belonging to a **verified admin** must be used and set as a “Bearer” token in the “Authorization” request header. The Data Export API supports using both the legacy Yammer OAuth 2 token and Azure Active Directory tokens acquired using MSAL. Learn more about supported authentication types [here](https://developer.yammer.com/docs/oauth-2). [block:code] { "codes": [ { "code": "GET /api/v1/messages/following.json HTTP/1.1 \nHost: www.yammer.com \nAuthorization: Bearer abcDefGhi", "language": "text" } ] } [/block] For more detail on the “Bearer” token refer to: http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-23 If the access token expires, or the user de-authorizes your app, the API request will return an HTTP 401 with the following error in the body of the response. [block:code] { "codes": [ { "code": "{\n \"response\": {\n \"message\": \"Token not found.\",\n \"code\": 16,\n \"stat\": \"fail\"\n }\n}", "language": "text" } ] } [/block] [block:api-header] { "title": "How this API works" } [/block] This API is synchronous - an HTTP request is made to the API and content is returned in the requested format. **Example Queries** * Export all data since February 9, 2020: [block:code] { "codes": [ { "code": "https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00", "language": "text" } ] } [/block] * Export all data since February 9, 2020, and until March 10th, 2021: [block:code] { "codes": [ { "code": "https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00&until=2021-03-10T00:00:00+00:00", "language": "text" } ] } [/block] * Export all data since February 9, 2020 but exclude file attachments: [block:code] { "codes": [ { "code": "https://export.yammer.com/api/v1/export?since=2020-02-09T00:00:00+00:00&include=csv", "language": "text" } ] } [/block] * Export message data since February 9, 2020, and exclude file attachments: [block:code] { "codes": [ { "code": "https://export.yammer.com/api/v1/export?since=2020-02-9T00:00:00+00:00&model=Message&include=csv", "language": "text" } ] } [/block] **Query Parameters:** - **model** - Indicates which models to be exported. All available models will be exported if no model is specified. Multiple models may be specified with multiple parameters with the 'model' name. Available models include: * User * Group * Message * MessageVersion * Topic * Tags * UploadedFileVersion - **since** - (Required parameter) - Indicates the start date of the export. All exported changes will have occurred on or after this date. Must be encoded as an ISO-8601 date. - **until** - Indicates the end date of the export. All exported changes will have occurred on or before this date (Note: Since export is looking at the until date at 00:00 GMT, use until today+1 if you cannot see the models created on the day of the export). If you're planning on a very large export, use "until" to break up the export into manageable pieces (data exports of a very large size may fail). Must be encoded as an ISO- 8601 date. If this value is not provided, until defaults to the current date. - **include** – Defines whether to include file attachments or not. Options are ‘csv’ (no attachments) or ‘all’ (include attachments). - **network** – Which network(s) one wishes to export. Must be accessible using the provided OAuth bearer token. i.e. the network associated with the token, or associated external networks. - **include_ens** – If ‘true’, automatically include all external networks associated with the network associated with the OAuth bearer token. Ensure that the parameters are correctly URL encoded before executing the request to the Data Export API. Some tools will handle this automatically, but you should check this when troubleshooting. [block:api-header] { "type": "basic", "title": "API Response" } [/block] The response is an application/zip (ZIP file) payload encapsulating the contents of the data export. Internally, the ZIP file will contain the following files and directories for a complete export: * Users.csv * Groups.csv * Messages.csv * MessageVersions.csv * Topics.csv * Tags.csv * Files.csv * files * Admins.csv * Networks.csv * log.txt * request.txt * Messages.csv vs MessageVersions.csv Message export follows these two criteria: * 1- Exports only versions that fall in the time search range * 2- If a message is the latest version, it will appear in both Messages.csv and * MessageVersions.csv. This means, if the latest version of a message is in the time range, it will be exported in both Messages.csv and MessageVersions.csv; any older version within the time range will only be exported in MessageVersions.csv. [block:api-header] { "title": "Response CSV Files Contents" } [/block] The following fields are exported in CSVs in the Data Export API. [block:parameters] { "data": { "h-0": "Users.csv", "h-1": "Groups.csv", "h-2": "Messages and MessageVersions.csv", "0-0": "id\nname\nemail\njob_title\nlocation\ndepartment\napi_url\ndeleted_by_id\ndeleted_by_type\njoined_at\ndeleted_at\nsuspended_by_id\nsuspended_by_type\nguid\nstate\noffice_user_id", "0-1": "id\nname\ndescription\nprivate\nmoderated\napi_url\ncreated_by_id\ncreated_by_type\ncreated_at\nupdated_at\ndeleted\nexternal\ncover_image\noffice_group_id", "0-2": "id\nreplied_to_id\nthread_id\nconversation_id\ngroup_id\ngroup_name\nparticipants\nin_private_group\nin_private_conversation\nsender_id\nsender_type\nsender_email\nbody\napi_url\nattachments*\ndeleted_by_id\ndeleted_by_type\ncreated_at\ndeleted_at\ntitle\nhtml_body\nmessage_type\ngdpr_delete_url", "h-3": "Topics.csv", "0-3": "id\nname\ncreated_by\ncreated_at\napi_url\ndescription" }, "cols": 4, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "Files.csv", "0-0": "id\nfile_id\nname\ndescription\nuploader_id\ngroup_id\ngroup_name\nreverted_to_id\ndeleted_by_user_id\nin_private_group\nin_private_conversation\nfile_api_url\ndownload_url\npath\nuploaded_at\ndeleted_at\nstorage_type", "h-1": "Tags.csv", "0-1": "id\nname", "h-2": "Admin.csv", "0-2": "id\nname\nemail\nverified", "h-3": "Networks.csv", "0-3": "id\npermalink\nname\nurl\npaid\ncreated_at\nmoderated\nusage_policy\nnumber_of_users\nsecure_browser_token" }, "cols": 4, "rows": 1 } [/block] *****Along with attachments this OGO information is now exported: id, url, title, description. **Potential Failure** If there are errors exporting any data, the data export will be a partial export. In this case, the log.txt will contain details of what failed to export. The best way to avoid partial failures is to export smaller timeframes at a time. Large data exports are more likely to fail. A Sample Code using the API in Unix and Windows PowerShell is provided [here](https://developer.yammer.com/v1.0/docs/code-samples). This Sample Code is provided for the purpose of illustration only and is not intended to be used as-is in a production environment.