{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"never","basic_auth":false,"params":[],"results":{"codes":[]},"try":true},"next":{"description":"","pages":[]},"title":"Impersonation","type":"basic","slug":"impersonation","excerpt":"","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.","updates":["54f50dd2e4dd350d00e65b72","57da39cc2bb38f0e00ef4150","58c84964f748731900683026"],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"546b91c8b47b5d1400109ef6","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"},"createdAt":"2014-11-18T18:36:56.866Z","parentDoc":null,"user":"5433099f9a2b451a00ad4531","__v":4,"category":{"sync":{"isSync":false,"url":""},"pages":["5451398d14af501a00b50d17","546b916b62515a14007ebc4b","546b91a862515a14007ebc4d","546b91c8b47b5d1400109ef6","546b91dab47b5d1400109ef8"],"title":"Authentication","slug":"authentication","order":3,"from_sync":false,"reference":false,"_id":"545138eaa66f020800dbab4a","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","__v":5,"createdAt":"2014-10-29T18:58:50.759Z"},"githubsync":"","project":"545137a814af501a00b50cf9"}
**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.