AnsweredAssumed Answered

Sudo in REST v10 (Sugar 7)

Question asked by MrWhammy MrWhammy on Mar 18, 2014
Latest reply on Sep 22, 2015 by MrWhammy MrWhammy
Hi,

I'm trying to use the sudo feature to impersonate another user.

I've followed this documentation:
http://developer.sugarcrm.com/2013/07/16/replacing-sudo_user-in-the-old-soap-api-in-the-new-sugar-7-rest-api/

In combination with
<sugar7url>/rest/10/help#endpoint_163_full

However, I can't reproduce the results in the first blog post. The /me endpoint always returns the signed in user, not the sudoed user. Below is an edited transcript of the HTTP communication.

What am I doing wrong?

Thanks,
Brecht

==========
 
POST  /sugarcrm7/rest/v10/oauth2/token HTTP/1.1 
...."username":"admin"....     HTTP/1.1  200 OK
...."access_token":"634f194c-4295-c426-444e-532314af17c2"....
==========  GET  /sugarcrm7/rest/v10/me HTTP/1.1
oauth-token:  634f194c-4295-c426-444e-532314af17c2
   HTTP/1.1  200 OK
...."user_name":"admin"...
==========  POST  /sugarcrm7/rest/v10/oauth2/sudo/v.vanderlinden HTTP/1.1
oauth-token:  634f194c-4295-c426-444e-532314af17c2
{"client_id":"sugar","platform":"base"}     HTTP/1.1  200 OK
...."access_token":"ec100701-5a04-9307-0042-532314ca1162"....
==========  GET  /sugarcrm7/rest/v10/me HTTP/1.1
oauth-token:  ec100701-5a04-9307-0042-532314ca1162
HTTP/1.1  200 OK
...."user_name":"admin"....
========== 

Outcomes