Step 1. I use API ( POST https://us-4.rightscale.com/api/users ) to create a user.
Step 2. I use API ( POST https://governance.rightscale.com/grs/orgs/ 28039/users ) to add a user into an org.
Step 3. I use API ( GET https://governance.rightscale.com/grs/orgs/28039/users ) to list all users in an org.
In Step 3, but I did not find the 'principal_uid' field in the JSON response.
If I use GET https://us-4.rightscale.com/api/users to list users, the result only includes my enterprise org's users.
Note: My enterprise Org# is 27845,My customer-org# is 28039.
So, how to list users by Customer-Org# and contains the 'principal_uid' field?
Thanks.
### create sso user
@idpHref = /api/identity_providers/123
@synnex_local_user_id = 12345
# @name createUser
POST https://us-4.rightscale.com/api/users
Content-Type: application/json
X-Api-Version: 1.5
Authorization: Bearer {{access_token}}
{
"user":{
"email":"mason-test@company.com",
"company":"Company name",
"first_name":"Mason",
"last_name":"Rao",
"phone":"123456789",
"identity_provider_href": "{{idpHref}}",
"principal_uid": "{{synnex_local_user_id}}"
}
}
// 添加成功后,在Response.Headers["Location"] 获得当前添加的user_id
### add user to a org
@user_id = 126549
POST https://governance.rightscale.com/grs/orgs/{{org_id}}/users
Content-Type: application/json
X-Api-Version: 2.0
Authorization: Bearer {{access_token}}
{
"id": "{{user_id}}",
"kind": "user"
}
### list all users in an org
GET https://governance.rightscale.com/grs/orgs/{{org_id}}/users
X-Api-Version: 2.0
Authorization: Bearer {{access_token}}
Dec 24, 2019 11:00 PM
Hello, currently the response for Users.show does not include the principal_uid field, so there is no way to show that value today in the API. https://reference.rightscale.com/api1.5/resources/ResourceUsers.html#show
If that is important to you, please describe your use case in detail (a private message can be used if needed) and we can document it as a feature request.
Thanks.
Jan 08, 2020 01:14 PM