{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Yammer Files Export API","type":"basic","slug":"yammer-files-export-api","excerpt":"Export files stored in Yammer cloud storage","body":"[block:api-header]\n{\n  \"title\": \"Introduction\"\n}\n[/block]\nThe Yammer Files Export API lets Verified Administrators archive and export files in Yammer storage in an asynchronous manner. This API is intended to augment the existing <a href = \"https://developer.yammer.com/docs/data-export-api\"> Data Export API</a> when there is a significant volume of files to be exported. In combination, these APIs allow networks with very large volumes of content to perform a complete export. The existing Data Export API should be the starting point for all developers.\n\nYou can perform a Files export by specifying the start and end date to which you would like to export. Data is exported into a Zip file containing a .csv file with information about the export and additional archives with files exported from your Yammer network. \n\nThe Files Export API is scoped only to asynchronously exporting Files stored in Yammer cloud storage in their native format. Files stored in SharePoint file storage will not be included in the Zip file, but the download_url in Files.csv will work if the user has access to those Files in SharePoint.\n\nUse the Yammer data export API to export all other content from your Yammer network, such as Messages, Users, Groups and Topics. The model parameters can be adapted to the content types that need to be exported.\n[block:api-header]\n{\n  \"title\": \"How this API works\"\n}\n[/block]\nThe existing Yammer APIs are synchronous. An HTTP request is made to the API and content is returned in the requested format. Data export payloads are much larger than that of REST endpoints which introduces challenges when large volumes of files are encountered.\n\nThe Yammer Files Export API is asynchronous. An initial request is made to the API and an export request ID is returned. The data export begins processing on the backend. Further requests are made using the request ID to check on progress. Once the request has processed another URL to the final export download is provided. This is a simple HTTP download compared to the streaming approach used by the <a href=\"https://developer.yammer.com/docs/data-export-api\"> Data Export API</a>. \n[block:api-header]\n{\n  \"title\": \"Authorization\"\n}\n[/block]\nOnly Yammer Verified Admins are authorized to make data export requests. The access token must be set as a “Bearer” token in the “Authorization” request header. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Authorization: Bearer [BEARER_TOKEN]\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nFor more details on “Bearer” token refer: <a href=\"https://developer.yammer.com/docs/api-requests\"> developer.yammer.com/docs/api-requests</a>\n\nIf the Bearer token has expired, then the API 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\\t“response”: {\\n\\t“message”: {Credentials are required to access this resource.”,\\n\\t“code”: 16,\\n\\t“stat”: “fail”\\n    }\\n }\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Creating a request to export files\"\n}\n[/block]\nThe following example demonstrates sending a POST request to export files.\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST yammer.com/api/v1/export/requests?since=2019-02-09T00:00:00&until=2019-03-10T00:00:00\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<b>Query parameters</b>\n• since: ISO-8601 encoded date string\n• until: ISO-8601 encoded date string (optional)\n• network: Which network(s) to export, must be accessible with OAuth bearer token\n• include_ens: If ‘true’, automatically include all external networks associated with the OAuth bearer token\n[block:api-header]\n{\n  \"title\": \"Success response\"\n}\n[/block]\nA successful response will return a “user_request_id” GUID with which you can check the status of your Files export.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 200 OK\\nCONTENT: \\n{“user_request_id”:”5e5716d6-2eb0-43d1-8782-fc9094058547”}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Error response\"\n}\n[/block]\nYammer Verified Admins can only run one Yammer Files Export at a time. Multiple API requests to export Files will return the following error.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 400 BAD REQUEST\\nCONTENT: \\n“Only one request can be in progress for one admin at a time. Existing Request Id: 5e5716d6-2eb0-43d1-8782-fc9094058547”\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Check status of your data export\"\n}\n[/block]\nYou can check the status of your Files export with your “User request ID”.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET yammer.com/api/v1/export/requests/{user_request_id}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"API responses\"\n}\n[/block]\nThe Yammer Files Export API returns the following responses.\n\n<b>IN PROGRESS:</b> This status indicates that your Yammer Files are being processed for export. Please check the status again to see if your request is complete with your user request id.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 200 OK\\nCONTENT:\\n{\\n\\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\\n\\t“status”\\t     : “IN PROGRESS”\\n\\t“expiry_time”    : “”\\n\\t“data”\\t     :[]\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<b>COMPLETE:</b> A successful response will return a status of complete, with two URLs, first URL containing files from the export, and a second URL containing a CSV with metadata regarding the downloaded files. The download URL automatically expires in one week week as indicated in the expiry time. Do not share the download URLs with individuals who shouldn't have access to the data.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 200 OK\\nCONTENT:\\n{\\n\\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\\n\\t“status”\\t     : “COMPLETE”\\n\\t“expiry_time”    : “2019-02-09T00:00:00:00+00:00”\\n\\t“data”\\t     :[\\n\\n\\\"https://dataexport-s0.assets-yammer.com/container/files.zip?st=2019-01-29T07%3A36%3A46Z&se=2019-01-30T07%3A36%3A46Z&sp=r&sv=2018-03-28&sr=b&sig=test”\\n]\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<b>EXPIRED:</b> This status indicates that the URL to download Files from Yammer has expired. Download URLs automatically expire one week after they are issued. Please create a new request to export files from Yammer.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 200 OK\\nCONTENT:\\n{\\n\\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\\n\\t“status”\\t     : “EXPIRED”\\n\\t“expiry_time”    : “2019-02-09T00:00:00+00:00”\\n\\t“data”\\t     :[]\\n}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<b>404 NOT FOUND:</b> This code is generated when there is no data export request available for the “user_request_id” that was provided.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 404 NOT FOUND\\nCONTENT: “No export request was found for the request_id: {user_request_id}”\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Expiring the Data Export URL\"\n}\n[/block]\nAfter a Verified Admin has completed downloading the files, it is recommended that the files data export URL is expired. The expiration process disables the URL and files cannot be downloaded.\n\n**Query \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PUT yammer.com/api/v1/export/requests/{user_request_id}?state=Expired\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<b>Query parameters</b>\nState = Expired\n\n**Success Response** \n\n200 OK\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 200 OK\\nCONTENT: \\\"Expiration process has successfully initiated. Data URLs will soon be disabled\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n**Error Responses**\n\n**401 UNAUTHORIZED** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 401 UNAUTHORIZED\\nCONTENT: \\\"Updating to a state other than 'Expired' is unauthorized\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n**400 BAD REQUEST** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 400 BAD REQUEST\\nCONTENT: \\\"Export with given {user_request_id} has already been expired or failed\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n**404 NOT FOUND** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"CODE: 404 NOT FOUND\\nCONTENT: \\\"No export request was found for the request_id: {user_request_id}\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5d07fcbcc9f18d010d5e1946","project":"545137a814af501a00b50cf9","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"],"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":11,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["547391bf007eb108007e042c"],"title":"Data Export API","slug":"data-export-api","order":7,"from_sync":false,"reference":false,"_id":"546ced235884600e007a92f6","__v":1,"project":"545137a814af501a00b50cf9","createdAt":"2014-11-19T19:18:59.863Z","version":"545137a814af501a00b50cfc"},"user":"5cd352a0d05b5a000f225f36","createdAt":"2019-06-17T20:49:00.488Z","__v":0,"parentDoc":null}

Yammer Files Export API

Export files stored in Yammer cloud storage

[block:api-header] { "title": "Introduction" } [/block] The Yammer Files Export API lets Verified Administrators archive and export files in Yammer storage in an asynchronous manner. This API is intended to augment the existing <a href = "https://developer.yammer.com/docs/data-export-api"> Data Export API</a> when there is a significant volume of files to be exported. In combination, these APIs allow networks with very large volumes of content to perform a complete export. The existing Data Export API should be the starting point for all developers. You can perform a Files export by specifying the start and end date to which you would like to export. Data is exported into a Zip file containing a .csv file with information about the export and additional archives with files exported from your Yammer network. The Files Export API is scoped only to asynchronously exporting Files stored in Yammer cloud storage in their native format. Files stored in SharePoint file storage will not be included in the Zip file, but the download_url in Files.csv will work if the user has access to those Files in SharePoint. Use the Yammer data export API to export all other content from your Yammer network, such as Messages, Users, Groups and Topics. The model parameters can be adapted to the content types that need to be exported. [block:api-header] { "title": "How this API works" } [/block] The existing Yammer APIs are synchronous. An HTTP request is made to the API and content is returned in the requested format. Data export payloads are much larger than that of REST endpoints which introduces challenges when large volumes of files are encountered. The Yammer Files Export API is asynchronous. An initial request is made to the API and an export request ID is returned. The data export begins processing on the backend. Further requests are made using the request ID to check on progress. Once the request has processed another URL to the final export download is provided. This is a simple HTTP download compared to the streaming approach used by the <a href="https://developer.yammer.com/docs/data-export-api"> Data Export API</a>. [block:api-header] { "title": "Authorization" } [/block] Only Yammer Verified Admins are authorized to make data export requests. The access token must be set as a “Bearer” token in the “Authorization” request header. [block:code] { "codes": [ { "code": "Authorization: Bearer [BEARER_TOKEN]", "language": "text" } ] } [/block] For more details on “Bearer” token refer: <a href="https://developer.yammer.com/docs/api-requests"> developer.yammer.com/docs/api-requests</a> If the Bearer token has expired, then the API will return an HTTP 401 with the following error in the body of the response. [block:code] { "codes": [ { "code": "{\n\t“response”: {\n\t“message”: {Credentials are required to access this resource.”,\n\t“code”: 16,\n\t“stat”: “fail”\n }\n }", "language": "text" } ] } [/block] [block:api-header] { "title": "Creating a request to export files" } [/block] The following example demonstrates sending a POST request to export files. [block:code] { "codes": [ { "code": "POST yammer.com/api/v1/export/requests?since=2019-02-09T00:00:00&until=2019-03-10T00:00:00", "language": "text" } ] } [/block] <b>Query parameters</b> • since: ISO-8601 encoded date string • until: ISO-8601 encoded date string (optional) • network: Which network(s) to export, must be accessible with OAuth bearer token • include_ens: If ‘true’, automatically include all external networks associated with the OAuth bearer token [block:api-header] { "title": "Success response" } [/block] A successful response will return a “user_request_id” GUID with which you can check the status of your Files export. [block:code] { "codes": [ { "code": "CODE: 200 OK\nCONTENT: \n{“user_request_id”:”5e5716d6-2eb0-43d1-8782-fc9094058547”}", "language": "text" } ] } [/block] [block:api-header] { "title": "Error response" } [/block] Yammer Verified Admins can only run one Yammer Files Export at a time. Multiple API requests to export Files will return the following error. [block:code] { "codes": [ { "code": "CODE: 400 BAD REQUEST\nCONTENT: \n“Only one request can be in progress for one admin at a time. Existing Request Id: 5e5716d6-2eb0-43d1-8782-fc9094058547”", "language": "text" } ] } [/block] [block:api-header] { "title": "Check status of your data export" } [/block] You can check the status of your Files export with your “User request ID”. [block:code] { "codes": [ { "code": "GET yammer.com/api/v1/export/requests/{user_request_id}", "language": "text" } ] } [/block] [block:api-header] { "title": "API responses" } [/block] The Yammer Files Export API returns the following responses. <b>IN PROGRESS:</b> This status indicates that your Yammer Files are being processed for export. Please check the status again to see if your request is complete with your user request id. [block:code] { "codes": [ { "code": "CODE: 200 OK\nCONTENT:\n{\n\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\n\t“status”\t : “IN PROGRESS”\n\t“expiry_time” : “”\n\t“data”\t :[]\n}", "language": "text" } ] } [/block] <b>COMPLETE:</b> A successful response will return a status of complete, with two URLs, first URL containing files from the export, and a second URL containing a CSV with metadata regarding the downloaded files. The download URL automatically expires in one week week as indicated in the expiry time. Do not share the download URLs with individuals who shouldn't have access to the data. [block:code] { "codes": [ { "code": "CODE: 200 OK\nCONTENT:\n{\n\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\n\t“status”\t : “COMPLETE”\n\t“expiry_time” : “2019-02-09T00:00:00:00+00:00”\n\t“data”\t :[\n\n\"https://dataexport-s0.assets-yammer.com/container/files.zip?st=2019-01-29T07%3A36%3A46Z&se=2019-01-30T07%3A36%3A46Z&sp=r&sv=2018-03-28&sr=b&sig=test”\n]\n}", "language": "text" } ] } [/block] <b>EXPIRED:</b> This status indicates that the URL to download Files from Yammer has expired. Download URLs automatically expire one week after they are issued. Please create a new request to export files from Yammer. [block:code] { "codes": [ { "code": "CODE: 200 OK\nCONTENT:\n{\n\t“user_request_id”: “5e5716d6-2eb0-43d1-8782-fc9094058547”,\n\t“status”\t : “EXPIRED”\n\t“expiry_time” : “2019-02-09T00:00:00+00:00”\n\t“data”\t :[]\n}", "language": "text" } ] } [/block] <b>404 NOT FOUND:</b> This code is generated when there is no data export request available for the “user_request_id” that was provided. [block:code] { "codes": [ { "code": "CODE: 404 NOT FOUND\nCONTENT: “No export request was found for the request_id: {user_request_id}”", "language": "text" } ] } [/block] [block:api-header] { "title": "Expiring the Data Export URL" } [/block] After a Verified Admin has completed downloading the files, it is recommended that the files data export URL is expired. The expiration process disables the URL and files cannot be downloaded. **Query [block:code] { "codes": [ { "code": "PUT yammer.com/api/v1/export/requests/{user_request_id}?state=Expired", "language": "text" } ] } [/block] <b>Query parameters</b> State = Expired **Success Response** 200 OK [block:code] { "codes": [ { "code": "CODE: 200 OK\nCONTENT: \"Expiration process has successfully initiated. Data URLs will soon be disabled\"", "language": "text" } ] } [/block] **Error Responses** **401 UNAUTHORIZED** [block:code] { "codes": [ { "code": "CODE: 401 UNAUTHORIZED\nCONTENT: \"Updating to a state other than 'Expired' is unauthorized\"", "language": "text" } ] } [/block] **400 BAD REQUEST** [block:code] { "codes": [ { "code": "CODE: 400 BAD REQUEST\nCONTENT: \"Export with given {user_request_id} has already been expired or failed\"", "language": "text" } ] } [/block] **404 NOT FOUND** [block:code] { "codes": [ { "code": "CODE: 404 NOT FOUND\nCONTENT: \"No export request was found for the request_id: {user_request_id}\"", "language": "text" } ] } [/block]