{"__v":20,"_id":"546fdf54a179880800187e8b","category":{"__v":55,"_id":"546b909462515a14007ebc43","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","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"],"reference":false,"createdAt":"2014-11-18T18:31:48.943Z","from_sync":false,"order":6,"slug":"rest-api","title":"REST API"},"project":"545137a814af501a00b50cf9","user":"5433099f9a2b451a00ad4531","version":{"__v":9,"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z","categories":["545137a814af501a00b50cfd","545138eaa66f020800dbab4a","546b9072b47b5d1400109edf","546b9082b47b5d1400109ee0","546b9088b47b5d1400109ee1","546b909462515a14007ebc43","546b90a0b47b5d1400109ee2","546ced235884600e007a92f6","5481008eea7fd40b00cd7c2b"],"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2014-11-22T00:56:52.354Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"order":0,"body":"Yammer provides a RESTful interface to the resources in the Yammer web interface e.g. messages, users, groups etc. Once your app has authenticated a Yammer user, it can call a REST API endpoint using your access token and get the corresponding resources. A simple example is getting the authenticated user’s profile information using the https://www.yammer.com/api/v1/users/current.json API endpoint.\n\nIf you are new to REST, you can understand the basics at http://en.wikipedia.org/wiki/REST. Please note that the endpoints support JSON (recommended) and XML. The documentation allows you to shift from JSON to XML where relevant.Timestamps are formatted according to RFC3339.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"WARNING!\",\n  \"body\": \"The Yammer REST API Explorer (\\\"Try It\\\") will GET, DELETE, and POST data to and from your home Yammer network. Use with caution!\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Rate Limits\"\n}\n[/block]\nAPI calls are subject to rate limiting. Exceeding any rate limits will result in all endpoints returning a status code of 429 (Too Many Requests). Rate limits are per user per app. There are four rate limits:\n\n*Autocomplete*: 10 requests in 10 seconds.\n\n*Messages*: 10 requests in 30 seconds.\n\n*Notifications*: 10 requests in 30 seconds.\n\n*All Other Resources*: 10 requests in 10 seconds.\n\nThese limits are independent e.g. in the same 30 seconds period, you could make 10 message calls and 10 notification calls. The specific rate limits are subject to change but following the guidelines below will ensure that your app is not blocked.\n\nMessages:\n\nWhen polling for messages, do not exceed one poll per minute. Apps that poll excessively will be blocked. However, your app may sometimes need to fetch messages more frequently e.g. if a user flips between “following”, “sent” and “received” feeds quickly: this is allowed for a few requests. Do not attempt to decrease message latency in your app by checking for new messages more frequently than once per minute.\n\nAutocomplete:\n\nThe autocomplete resources allow for more frequent polling than other resources, as they are meant to enable realtime responses for a user as they type. See the autocomplete section below to understand how to use this feature.\n\nOther Resources:\n\nRate limits for all other resources are tuned to virtually guarantee that a normally functioning client serving even a heavy Yammer user will not run into rate limit problems.\n\n\n**Admin Actions**\n\nIn order to perform administrative API actions such as creating and deleting users, the access token should belong to a verified admin user in paid Yammer networks.\n\n\n**Versioning**\n\nThe API version is shown in the URLs of the endpoints e.g. /api/v1.\n\nDevelopers should expect that new elements could be added to the XML document or the JSON data structure, in an API version. If elements are removed, we will typically release a new version of the API. The ordering of items within the data structures is not guaranteed. For example, the order of the foo and bar items in the excerpts below might be swapped in the same version of the API:\n\nXML\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<things> <foo>Foo!</foo> <bar>Bar!</bar> </things>\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nJSON\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{ \\\"things\\\": { \\\"foo\\\": \\\"Foo!\\\", \\\"bar\\\": \\\"Bar!\\\" } }\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"rest-api-rate-limits","type":"basic","title":"REST API & Rate Limits"}

REST API & Rate Limits


Yammer provides a RESTful interface to the resources in the Yammer web interface e.g. messages, users, groups etc. Once your app has authenticated a Yammer user, it can call a REST API endpoint using your access token and get the corresponding resources. A simple example is getting the authenticated user’s profile information using the https://www.yammer.com/api/v1/users/current.json API endpoint. If you are new to REST, you can understand the basics at http://en.wikipedia.org/wiki/REST. Please note that the endpoints support JSON (recommended) and XML. The documentation allows you to shift from JSON to XML where relevant.Timestamps are formatted according to RFC3339. [block:callout] { "type": "danger", "title": "WARNING!", "body": "The Yammer REST API Explorer (\"Try It\") will GET, DELETE, and POST data to and from your home Yammer network. Use with caution!" } [/block] [block:api-header] { "type": "basic", "title": "Rate Limits" } [/block] API calls are subject to rate limiting. Exceeding any rate limits will result in all endpoints returning a status code of 429 (Too Many Requests). Rate limits are per user per app. There are four rate limits: *Autocomplete*: 10 requests in 10 seconds. *Messages*: 10 requests in 30 seconds. *Notifications*: 10 requests in 30 seconds. *All Other Resources*: 10 requests in 10 seconds. These limits are independent e.g. in the same 30 seconds period, you could make 10 message calls and 10 notification calls. The specific rate limits are subject to change but following the guidelines below will ensure that your app is not blocked. Messages: When polling for messages, do not exceed one poll per minute. Apps that poll excessively will be blocked. However, your app may sometimes need to fetch messages more frequently e.g. if a user flips between “following”, “sent” and “received” feeds quickly: this is allowed for a few requests. Do not attempt to decrease message latency in your app by checking for new messages more frequently than once per minute. Autocomplete: The autocomplete resources allow for more frequent polling than other resources, as they are meant to enable realtime responses for a user as they type. See the autocomplete section below to understand how to use this feature. Other Resources: Rate limits for all other resources are tuned to virtually guarantee that a normally functioning client serving even a heavy Yammer user will not run into rate limit problems. **Admin Actions** In order to perform administrative API actions such as creating and deleting users, the access token should belong to a verified admin user in paid Yammer networks. **Versioning** The API version is shown in the URLs of the endpoints e.g. /api/v1. Developers should expect that new elements could be added to the XML document or the JSON data structure, in an API version. If elements are removed, we will typically release a new version of the API. The ordering of items within the data structures is not guaranteed. For example, the order of the foo and bar items in the excerpts below might be swapped in the same version of the API: XML [block:code] { "codes": [ { "code": "<things> <foo>Foo!</foo> <bar>Bar!</bar> </things>", "language": "text" } ] } [/block] JSON [block:code] { "codes": [ { "code": "{ \"things\": { \"foo\": \"Foo!\", \"bar\": \"Bar!\" } }", "language": "text" } ] } [/block]