Let the platform do the work

/oauth2/sudo/:user_name POST

Overview

Get an access token as another user. The current user must be an admin in order to access this endpoint. This method is useful for integrations in order to be able to access the system with the same permission restrictions as a specified user. The calling user does not lose their existing token, this one is granted in addition.

Request Arguments

Name Type Description Required
platform String Which platform on the session, defaults to "base" False
client_id String The client id for the session, defaults to "sugar" False

Request

{
   "client_id":"sugar",
   "platform":"base"
}

Response Arguments

Name Type Description
access_token String The access token needed to authenticate for other methods.
expires_in Integer The length of time until the access_token expires.
token_type String Should always be bearer.
scope String There is no scope implementation in the current release of Sugar.

Response

{
   "access_token":"c19fff9b-b767-233e-ebb4-512e369d3e39",
   "expires_in":3600,
   "token_type":"bearer",
   "scope":null
}

Change Log

Version Change
v10 Added /oauth2/token/sudo/:user POST endpoint.