Unify and manage your data

Add Or Update User External Token

Learn about the API operation to add or update an external user's token

Table 1. Endpoint Details
Request TypePUT
URL

/oauth/users/{userID}/externalTokens/{systemId}

Notes:
  • userId- user's login
  • systemId- ID of external system, e.g. "facebook", "twitter", "linkedin"
Parameters JSON object with a new external token:
 {  
   "systemId"   "ext_system",
   "value"   "1234-56789-00000-abcde-fghi"   "attributes"   {  
      "valid_till"      "00000"
   }
}{ "systemId" "ext_system", "value" "1234-56789-00000-abcde-fghi" "attributes" { "valid_till" "00000" }}
Not attributes are optional.
AccessAccess ROLE_ADMIN_TENANT or ROLE_USER and the same user

Request

curl -k -H
"Accept: application/json" -H
"Authorization: Bearer 5925f793-c092-43ec-b3a3-65ce8e194440" -X
PUT -d
'{
    "systemId" : "facebook",
    "value" : "2452-25215-52152-dsgsd-gdsg"
    "attributes" : {
        "valid_till" : "21421"
    }
}'
http://localhost:8080/oauth/users/lee_eybe/externalTokens/facebook
Response
{
  "systemId" : "facebook",
  "value" : "2452-25215-52152-dsgsd-gdsg"
  "attributes" : {
      "valid_till" : "21421"
   }
}