{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/uploadSmallFile","auth":"required","method":"post","examples":{"codes":[]},"results":{"codes":[{"language":"text","code":""}]},"settings":"5d8e6eef85830e0067f4244f","params":[{"name":"network_id","type":"long","default":"","desc":"Your Yammer Network's ID","required":true,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a87"},{"name":"target_type","type":"string","default":"","desc":"The type of upload, specify GROUP or PRIVATE_MESSAGE. If uploading to All Company group that has 'company' as the group feed id specify ALL_COMPANY or for networks that have a numeric feed id for All Company group specify GROUP. No other target type is acceptable.","required":true,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a86"},{"name":"filename","type":"string","default":"","desc":"UTF8 name of the file being uploaded","required":true,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a85"},{"name":"file","type":"file","default":"","desc":"File that needs to be uploaded into Yammer. Max file size is 4MB","required":true,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a84"},{"name":"fileid","type":"long","default":"","desc":"1. absent for a new file, 2. The id of an existing file for version upload","required":false,"in":"body","ref":"","_id":"5e84c22876618f0050c9d18b"},{"name":"group_id","type":"int","default":"","desc":"Yammer Group ID where the file needs to be uploaded. This field should not be present if the file is being uploaded to Private Messages. This field should also not be present if the file is being uploaded to All Company group for networks that have 'company' as the feed id for their All Company group. For networks with a numeric feed id for All Company group specify the Group ID.","required":false,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a83"},{"name":"thread_id","type":"string","default":"","desc":"ID of the Yammer thread to which this file needs to be attached. This field should not be present if the file is a non-thread attachment. Providing the thread_id will not attach the file to the message, it will just upload to the group. Use POST messages.json API to attach the file to the thread.","required":false,"in":"body","ref":"","_id":"5d9bb9e346368702d74a2a82"}]},"next":{"description":"","pages":[]},"title":"Upload Files into Yammer","type":"endpoint","slug":"upload-files-into-yammer-groups","excerpt":"","body":"This API enables file upload into a Yammer group. The request should be in a multipart/form-data request format. An Azure Active Directory (AAD) token is required for uploading files into an Office 365 Connected Yammer Group. Upload file size limit is 4MB.\n[block:api-header]\n{\n  \"title\": \"Where uploaded files are stored?\"\n}\n[/block]\nIf your Yammer network is enabled with Files in SharePoint, then uploaded files to Office 365 Connected Yammer Groups are stored in SharePoint.\n\nIf your Yammer network is not enabled with Files in SharePoint, then all files uploaded using this API will be stored in Yammer cloud storage.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Target_type\",\n    \"h-1\": \"File storage location\",\n    \"0-0\": \"ALL_COMPANY\",\n    \"0-1\": \"If your All Company group is connected then new files for Office 365 connected groups are stored in the SharePoint document library for the group. They are visible in the Yammer group's Files list, or from the Apps/Yammer folder in the group's SharePoint document library.\\n\\nIf your All Company group is not connected then files remain in Yammer cloud storage.\",\n    \"1-0\": \"PRIVATE_MESSAGE\",\n    \"1-1\": \"Uploaded into Yammer cloud storage\",\n    \"2-0\": \"Yammer GROUP (Office 365 Connected)\",\n    \"2-1\": \"Uploaded into SharePoint storage dedicated to that group\",\n    \"3-0\": \"Yammer GROUP (Unconnected)\",\n    \"3-1\": \"Uploaded into Yammer cloud storage\",\n    \"h-2\": \"Comments\",\n    \"2-2\": \"File\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"API responses\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Response\",\n    \"h-1\": \"Reason\",\n    \"0-1\": \"Occurs when file is successfully uploaded into Yammer\",\n    \"0-0\": \"201 CREATED\",\n    \"h-2\": \"\",\n    \"0-2\": \"\",\n    \"2-0\": \"500 SERVER ERROR\",\n    \"2-2\": \"\",\n    \"2-1\": \"Occurs when the required fields are not included\",\n    \"3-0\": \"201 CREATED\",\n    \"3-1\": \"Occurs when file is successfully uploaded into Yammer\",\n    \"1-0\": \"400 BAD REQUEST\",\n    \"1-1\": \"a) NoFilenameProvided Occurs when no filename is provided (which is a required parameter). \\n\\n(b) NoNetworkIdProvided Occurs when no network id is provided (which is a required parameter). \\n\\n(c) NoTargetTypeProvided Occurs when no target type is provided (which is a required parameter). \\n\\n(d) InvalidTargetTypeProvided Occurs when the target type provided is not a valid one (not ALL_COMPANY, PRIVATE_MESSAGE, or GROUP).  \\n\\n(e) NoFileProvided Occurs when no file is attached (which is required).  \\n\\n(d) InvalidTargetTypeGroupIDPair Occurs\\n when target_type is selected as GROUP, but no GROUP_ID is included. Or, when target_type is ALL_COMPANY (or PRIVATE_MESSAGE), and a GROUP_ID is included. \\n\\n(e) InvalidFilename Occurs when the filename has invalid characters, e.g., \\\"*:<>?|/\\\\ The recommendation is to rename the file and try the upload again.\",\n    \"4-0\": \"401 UNAUTHORIZED\",\n    \"4-1\": \"Occurs when no valid authentication is provided\",\n    \"5-0\": \"403  FORBIDDEN\",\n    \"5-1\": \"OneDriveForbidden Occurs when the upload happens in an Office 365 Connected Yammer Group, but the user does not have permissions in SharePoint to upload the file. For example, if the group is private and the user is not a member of the group.\",\n    \"6-0\": \"404  NOT_FOUND\",\n    \"6-1\": \"OneDriveNotFound Usually occurs in scenarios where an Office 365 Connected Yammer Group has just been created and resources have not been provisioned yet. The recommendation is to try the upload at a later time.\",\n    \"7-0\": \"409  CONFLICT\",\n    \"7-1\": \"OneDriveConflict Occurs when another user has uploaded a file with the same name at the same time. The recommendation is to try the upload at a later time.\",\n    \"8-0\": \"415  UNSUPPORTED MEDIA TYPE\",\n    \"8-1\": \"NetworkFileUploadMediaOnly Occurs when the network has set up a policy that allows only media files (images and videos), but the user tries to upload a different file type.\",\n    \"9-0\": \"429  TOO MANY REQUESTS\",\n    \"9-1\": \"OneDriveTooManyRequests Occurs when too many requests happen at the same time. The recommendation is to try the upload at a later time.\",\n    \"10-0\": \"500 SERVER ERROR\",\n    \"10-1\": \"Occurs for server-related failures.\"\n  },\n  \"cols\": 2,\n  \"rows\": 11\n}\n[/block]","updates":[],"order":54,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5d9bb9e346368702d74a2a81","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","5ee004f52c97b4004c7a5876"],"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":12,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["546fdf54a179880800187e8b","54738e24007eb108007e03ff","54738e7d1a20c70800e189b0","54738e8a007eb108007e0404","54738e9b1a20c70800e189b2","54738ec0007eb108007e0407","54738ed21a20c70800e189b5","54738ee2007eb108007e0414","54738f05007eb108007e0416","54738f23007eb108007e0418","54738f31007eb108007e041a","547f80f9b7c1e40800dcf46f","547f9758b7c1e40800dcf4c2","547f9a3f3031bc0800e5fec4","547fa5f63031bc0800e5fef3","547fa632b7c1e40800dcf4e9","547fa696b7c1e40800dcf4ec","547fa6cc3031bc0800e5fef6","547fab89b7c1e40800dcf511","547facedb7c1e40800dcf51f","547faeef3031bc0800e5ff2d","547fafb03031bc0800e5ff31","547fb05ab7c1e40800dcf52a","547fb07a3031bc0800e5ff38","547fb0c4b7c1e40800dcf531","547fb100b7c1e40800dcf535","547fb18c3031bc0800e5ff41","547fb2433031bc0800e5ff44","547fb2feb7c1e40800dcf539","547fb335b7c1e40800dcf53b","547fb4aa3031bc0800e5ff49","547fb4f4b7c1e40800dcf541","547fb553b7c1e40800dcf544","54809ecd5f83dd0800c38fd3","54809f715f83dd0800c38fd6","54809fa8a3e4ea22000976b7","54809fd3a3e4ea22000976ba","5480a00ba3e4ea22000976bc","5480f44dea7fd40b00cd7c06","5480f4fb0e664d0b00be35f9","5480f5a5ea7fd40b00cd7c0b","5480f607ea7fd40b00cd7c10","5480f657ea7fd40b00cd7c12","5480f69a0e664d0b00be35ff","5480f77aea7fd40b00cd7c14","5480f7e7ea7fd40b00cd7c18","5480f83dea7fd40b00cd7c1b","5480f950ea7fd40b00cd7c1e","5480f9a6ab84321d00eaf538","5480faa8ea7fd40b00cd7c22","5480fb0aea7fd40b00cd7c25","5480fbd8ea7fd40b00cd7c27","5480fc64ab84321d00eaf53c","54c01ec89290010d00934956","55581594e54fe019002a4f2c","556e8b29fc3aa80d00e1a953"],"title":"REST API","slug":"rest-api","order":2,"from_sync":false,"reference":true,"_id":"546b909462515a14007ebc43","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","__v":56,"createdAt":"2014-11-18T18:31:48.943Z"},"user":"5cd352a0d05b5a000f225f36","createdAt":"2019-10-07T22:19:15.262Z","__v":15,"parentDoc":null}

postUpload Files into Yammer


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

network_id:
required
long
Your Yammer Network's ID
target_type:
required
string
The type of upload, specify GROUP or PRIVATE_MESSAGE. If uploading to All Company group that has 'company' as the group feed id specify ALL_COMPANY or for networks that have a numeric feed id for All Company group specify GROUP. No other target type is acceptable.
filename:
required
string
UTF8 name of the file being uploaded
file:
required
file
File that needs to be uploaded into Yammer. Max file size is 4MB
fileid:
long
1. absent for a new file, 2. The id of an existing file for version upload
group_id:
integer
Yammer Group ID where the file needs to be uploaded. This field should not be present if the file is being uploaded to Private Messages. This field should also not be present if the file is being uploaded to All Company group for networks that have 'company' as the feed id for their All Company group. For networks with a numeric feed id for All Company group specify the Group ID.
thread_id:
string
ID of the Yammer thread to which this file needs to be attached. This field should not be present if the file is a non-thread attachment. Providing the thread_id will not attach the file to the message, it will just upload to the group. Use POST messages.json API to attach the file to the thread.

Documentation

This API enables file upload into a Yammer group. The request should be in a multipart/form-data request format. An Azure Active Directory (AAD) token is required for uploading files into an Office 365 Connected Yammer Group. Upload file size limit is 4MB. [block:api-header] { "title": "Where uploaded files are stored?" } [/block] If your Yammer network is enabled with Files in SharePoint, then uploaded files to Office 365 Connected Yammer Groups are stored in SharePoint. If your Yammer network is not enabled with Files in SharePoint, then all files uploaded using this API will be stored in Yammer cloud storage. [block:parameters] { "data": { "h-0": "Target_type", "h-1": "File storage location", "0-0": "ALL_COMPANY", "0-1": "If your All Company group is connected then new files for Office 365 connected groups are stored in the SharePoint document library for the group. They are visible in the Yammer group's Files list, or from the Apps/Yammer folder in the group's SharePoint document library.\n\nIf your All Company group is not connected then files remain in Yammer cloud storage.", "1-0": "PRIVATE_MESSAGE", "1-1": "Uploaded into Yammer cloud storage", "2-0": "Yammer GROUP (Office 365 Connected)", "2-1": "Uploaded into SharePoint storage dedicated to that group", "3-0": "Yammer GROUP (Unconnected)", "3-1": "Uploaded into Yammer cloud storage", "h-2": "Comments", "2-2": "File" }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "title": "API responses" } [/block] [block:parameters] { "data": { "h-0": "Response", "h-1": "Reason", "0-1": "Occurs when file is successfully uploaded into Yammer", "0-0": "201 CREATED", "h-2": "", "0-2": "", "2-0": "500 SERVER ERROR", "2-2": "", "2-1": "Occurs when the required fields are not included", "3-0": "201 CREATED", "3-1": "Occurs when file is successfully uploaded into Yammer", "1-0": "400 BAD REQUEST", "1-1": "a) NoFilenameProvided Occurs when no filename is provided (which is a required parameter). \n\n(b) NoNetworkIdProvided Occurs when no network id is provided (which is a required parameter). \n\n(c) NoTargetTypeProvided Occurs when no target type is provided (which is a required parameter). \n\n(d) InvalidTargetTypeProvided Occurs when the target type provided is not a valid one (not ALL_COMPANY, PRIVATE_MESSAGE, or GROUP). \n\n(e) NoFileProvided Occurs when no file is attached (which is required). \n\n(d) InvalidTargetTypeGroupIDPair Occurs\n when target_type is selected as GROUP, but no GROUP_ID is included. Or, when target_type is ALL_COMPANY (or PRIVATE_MESSAGE), and a GROUP_ID is included. \n\n(e) InvalidFilename Occurs when the filename has invalid characters, e.g., \"*:<>?|/\\ The recommendation is to rename the file and try the upload again.", "4-0": "401 UNAUTHORIZED", "4-1": "Occurs when no valid authentication is provided", "5-0": "403 FORBIDDEN", "5-1": "OneDriveForbidden Occurs when the upload happens in an Office 365 Connected Yammer Group, but the user does not have permissions in SharePoint to upload the file. For example, if the group is private and the user is not a member of the group.", "6-0": "404 NOT_FOUND", "6-1": "OneDriveNotFound Usually occurs in scenarios where an Office 365 Connected Yammer Group has just been created and resources have not been provisioned yet. The recommendation is to try the upload at a later time.", "7-0": "409 CONFLICT", "7-1": "OneDriveConflict Occurs when another user has uploaded a file with the same name at the same time. The recommendation is to try the upload at a later time.", "8-0": "415 UNSUPPORTED MEDIA TYPE", "8-1": "NetworkFileUploadMediaOnly Occurs when the network has set up a policy that allows only media files (images and videos), but the user tries to upload a different file type.", "9-0": "429 TOO MANY REQUESTS", "9-1": "OneDriveTooManyRequests Occurs when too many requests happen at the same time. The recommendation is to try the upload at a later time.", "10-0": "500 SERVER ERROR", "10-1": "Occurs for server-related failures." }, "cols": 2, "rows": 11 } [/block]