TIBCO Data Virtualization® > Business Directory REST API > Business Directory REST APIs > userProfiles
 
userProfiles
The following operations can be performed on the userProfiles:
GET /userProfiles
PUT /userProfiles
DELETE /userProfiles
GET /userProfiles/locale
GET /userProfiles/{userParam}
GET /userProfiles
This API is used to Fetch all user profiles.
Parameters
None
Example to list all profiles
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/userProfiles"
Example to list all profiles as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/ userProfiles"
Equivalent system query
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/data/query" -H "query:select * from ALL_USER_PROFILES" -H "standardSQL:true" -H "system:true"
Example to retrieve count of all profiles
curl -X GET -u admin:admin "https://localhost:9502/rest v2/ userProfiles?count"
PUT /userProfiles
This API is used to create or update a user profile for a user. The provided JSON should be a UserProfileBean containing firstName, lastName and email.Special characters must be escaped where required.
Parameters
None
Request Body
{
"firstName": "string",
"lastName": "string",
"email": "string",
"locale": "string",
"profileEmpty": true
}
Example to create a user profile
curl -X PUT -u user:password "https://localhost:9502/rest/v2/userProfiles" -H "Content-Type:application/json" -d "{\"firstName\":\"myFirstName\", \"lastName\":\"myLastName\", \"email\":\"myemail@gmail.com\"}"
Example to update user profile with a different email
curl -X PUT -u user:password "https://localhost:9502/rest/v2/userProfiles" -H "Content-Type:application/json" -d "{\"firstName\":\"myFirstName\", \"lastName\":\"myLastName\", \"email\":\"differentemail@gmail.com\"}"
Example to update user profile with a different email as ldap user
curl -X PUT -u user@ldapDomain:password "https://localhost:9502/rest/v2/userProfiles" -H "Content-Type:application/json" -d "{\"firstName\":\"myFirstName\", \"lastName\":\"myLastName\", \"email\":\"differentemail@gmail.com\"}"
Example to update user profile with a different email (X-HTTP-Method- Override)
curl -X POST -u user:password "https://localhost:9502/rest/v2/userProfiles" -H "X-HTTP-Method-Override:PUT" -H "Content-Type:application/json" -d "{\"firstName\":\"myFirstName\", \"lastName\":\"myLastName\", \"email\":\"differentemail@gmail.com\"}"
DELETE /userProfiles
This API is used to delete the caller's user profile, if it exists.
Parameters
None
Example to delete User profile
curl -X DELETE -u admin:admin "https://localhost:9502/rest/v2/userProfiles" -H "Content-Type:application/json"
Example to delete User profile as ldap user
curl -X DELETE -u user@ldapDomain:password "https://localhost:9502/rest/ v2/ userProfiles" -H "Content-Type:application/json"
Example to delete User profile (X-HTTP-Method-Override)
curl -X POST -u admin:admin "https://localhost:9502/rest/v2/userProfiles" -H "X-HTTP-Method-Override:DELETE" -H "Content-Type:application/json"
GET /userProfiles/locale
This API is used to get the caller's locale from user profile, if it exists.
Parameters
None
Example to get User Locale
curl -X GET -u admin:admin "https://localhost:9502/rest/v1/userProfiles/ locale"
Example to get User Locale as ldap user
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v1/userProfiles/locale"
GET /userProfiles/{userParam}
This API is used to fetch a user profile by name and domain or by id.
Parameters
Name
Description
Parameter Type
Data Type
userParam
A string representing the user name and domain in user@domain format or a string representing the user's id.
path
string
Example to fetch one user profile by user name and domain
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/userProfiles/admin@composite"
Example to fetch one user profile by id
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/ userProfiles/-1973"
Equivalent system query (by name and domain)
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/data/query" -H "query:select * from ALL_USER_PROFILES WHERE USER_ID = (SELECT USER_ID FROM ALL_USERS WHERE USERNAME='admin' AND DOMAIN_NAME='composite')" -H "standardSQL:true" -H "system:true"
Equivalent system query (by ID)
curl -X GET -u admin:admin "https://localhost:9502/rest/v2/data/query" -H "query:select * from ALL_USER_PROFILES WHERE USER_ID = -1973" -H "standardSQL:true" -H "system:true"
Equivalent system query (as ldap user)
curl -X GET -u user@ldapDomain:password "https://localhost:9502/rest/v2/data/query" -H "query:select * from ALL_USER_PROFILES WHERE USER_ID = -1973" -H "standardSQL:true" -H "system:true"