{"_id":"546b91c8b47b5d1400109ef6","version":{"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":11,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z","categories":["545137a814af501a00b50cfd","545138eaa66f020800dbab4a","546b9072b47b5d1400109edf","546b9082b47b5d1400109ee0","546b9088b47b5d1400109ee1","546b909462515a14007ebc43","546b90a0b47b5d1400109ee2","546ced235884600e007a92f6","5481008eea7fd40b00cd7c2b","573b9d83ee2b3b220042291f","57be1efa15efc70e006a5f99"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"user":"5433099f9a2b451a00ad4531","__v":4,"category":{"_id":"545138eaa66f020800dbab4a","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","__v":5,"pages":["5451398d14af501a00b50d17","546b916b62515a14007ebc4b","546b91a862515a14007ebc4d","546b91c8b47b5d1400109ef6","546b91dab47b5d1400109ef8"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-29T18:58:50.759Z","from_sync":false,"order":3,"slug":"authentication","title":"Authentication"},"githubsync":"","project":"545137a814af501a00b50cf9","updates":["54f50dd2e4dd350d00e65b72","57da39cc2bb38f0e00ef4150","58c84964f748731900683026"],"next":{"pages":[],"description":""},"createdAt":"2014-11-18T18:36:56.866Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":3,"body":"**OAuth 2.0 Impersonation** \nImpersonation allows you to request a valid access token on behalf of a user for your app. This action is restricted to verified Yammer admins, and only in paid Yammer networks. Here are the API endpoints for this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET https://www.yammer.com/api/v1/oauth/tokens.json\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nGenerates (if necessary) and returns a list of authorized OAuth 2.0 access tokens for each network which the user is a member of. This supports the following parameters passed in the query string:\n\n`user_id` – string. The user_id of the user on behalf of whom you are generating the access tokens.\n\n`consumer_key` – string. The app’s consumer key which is available in the app that you registered.\n\nVerified Admins may use the user_id and consumer_key parameters to generate tokens on behalf of other users. Non-Admins are not able to use these parameters, only getting back oauth tokens for networks that they are a part of.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST https://www.yammer.com/api/v1/oauth.json\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis action is restricted to verified admins only. It supports the “user_id” and “consumer_key” parameters and returns a preauthorized OAuth access token for a given user_id/consumer_key combination.","excerpt":"","slug":"impersonation","type":"basic","title":"Impersonation"}
**OAuth 2.0 Impersonation** Impersonation allows you to request a valid access token on behalf of a user for your app. This action is restricted to verified Yammer admins, and only in paid Yammer networks. Here are the API endpoints for this: [block:code] { "codes": [ { "code": "GET https://www.yammer.com/api/v1/oauth/tokens.json", "language": "text" } ] } [/block] Generates (if necessary) and returns a list of authorized OAuth 2.0 access tokens for each network which the user is a member of. This supports the following parameters passed in the query string: `user_id` – string. The user_id of the user on behalf of whom you are generating the access tokens. `consumer_key` – string. The app’s consumer key which is available in the app that you registered. Verified Admins may use the user_id and consumer_key parameters to generate tokens on behalf of other users. Non-Admins are not able to use these parameters, only getting back oauth tokens for networks that they are a part of. [block:code] { "codes": [ { "code": "POST https://www.yammer.com/api/v1/oauth.json", "language": "text" } ] } [/block] This action is restricted to verified admins only. It supports the “user_id” and “consumer_key” parameters and returns a preauthorized OAuth access token for a given user_id/consumer_key combination.