API user - RapturePlatform/Rapture GitHub Wiki

User API

The user API contains methods for users to query and manipulate their own accounts and sessions.

getWhoAmI

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureUser retVal = userApi.getWhoAmI();
retVal = baseAPI.doUser_GetWhoAmI();

Entitlement: /everyone

Returns account information for the current user.

Function Parameters

This function takes no parameters.

Return value

Type Description
RaptureUser
Types used in this function

RaptureUser

Defines a user account for the Rapture system.

Field Type
username String
userId String
emailAddress String
salt String
hashPassword String
description String
inactive Boolean
apiKey Boolean
hasRoot Boolean
passwordResetToken String
tokenExpirationTime Long

logoutUser

HttpUserApi userApi = new HttpUserApi(loginApi);
void retVal = userApi.logoutUser();
retVal = baseAPI.doUser_LogoutUser();

Entitlement: /everyone

Logs out the active user and terminates the current session.

Function Parameters

This function takes no parameters.

Return value

Type Description
void

storePreference

HttpUserApi userApi = new HttpUserApi(loginApi);
void retVal = userApi.storePreference(category, name, content);
retVal = baseAPI.doUser_StorePreference(category, name, content);

Entitlement: /user/preferences

Stores application preferences for the current user.

Function Parameters

Parameter Type Description
category String
name String
content String

Return value

Type Description
void

getPreference

HttpUserApi userApi = new HttpUserApi(loginApi);
String retVal = userApi.getPreference(category, name);
retVal = baseAPI.doUser_GetPreference(category, name);

Entitlement: /user/preferences

Retrieves application preferences for the current user.

Function Parameters

Parameter Type Description
category String
name String

Return value

Type Description
String

removePreference

HttpUserApi userApi = new HttpUserApi(loginApi);
void retVal = userApi.removePreference(category, name);
retVal = baseAPI.doUser_RemovePreference(category, name);

Entitlement: /user/preferences

Removes a previously stored preference.

Function Parameters

Parameter Type Description
category String
name String

Return value

Type Description
void

getPreferenceCategories

HttpUserApi userApi = new HttpUserApi(loginApi);
List<String> retVal = userApi.getPreferenceCategories();
retVal = baseAPI.doUser_GetPreferenceCategories();

Entitlement: /user/preferences

This method will list the categories of preferences available for a user.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getPreferencesInCategory

HttpUserApi userApi = new HttpUserApi(loginApi);
List<String> retVal = userApi.getPreferencesInCategory(category);
retVal = baseAPI.doUser_GetPreferencesInCategory(category);

Entitlement: /user/preferences

This method will list the preference documents in a category.

Function Parameters

Parameter Type Description
category String

Return value

Type Description
List

updateMyDescription

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureUser retVal = userApi.updateMyDescription(description);
retVal = baseAPI.doUser_UpdateMyDescription(description);

Entitlement: /everyone

Updates the description for the current user.

Function Parameters

Parameter Type Description
description String

Return value

Type Description
RaptureUser
Types used in this function

RaptureUser

Defines a user account for the Rapture system.

Field Type
username String
userId String
emailAddress String
salt String
hashPassword String
description String
inactive Boolean
apiKey Boolean
hasRoot Boolean
passwordResetToken String
tokenExpirationTime Long

changeMyPassword

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureUser retVal = userApi.changeMyPassword(oldHashPassword, newHashPassword);
retVal = baseAPI.doUser_ChangeMyPassword(oldHashPassword, newHashPassword);

Entitlement: /everyone

Changes the password for the current user.

Function Parameters

Parameter Type Description
oldHashPassword String
newHashPassword String

Return value

Type Description
RaptureUser
Types used in this function

RaptureUser

Defines a user account for the Rapture system.

Field Type
username String
userId String
emailAddress String
salt String
hashPassword String
description String
inactive Boolean
apiKey Boolean
hasRoot Boolean
passwordResetToken String
tokenExpirationTime Long

changeMyEmail

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureUser retVal = userApi.changeMyEmail(newAddress);
retVal = baseAPI.doUser_ChangeMyEmail(newAddress);

Entitlement: /everyone

Changes the email for the current user.

Function Parameters

Parameter Type Description
newAddress String

Return value

Type Description
RaptureUser
Types used in this function

RaptureUser

Defines a user account for the Rapture system.

Field Type
username String
userId String
emailAddress String
salt String
hashPassword String
description String
inactive Boolean
apiKey Boolean
hasRoot Boolean
passwordResetToken String
tokenExpirationTime Long

getServerApiVersion

HttpUserApi userApi = new HttpUserApi(loginApi);
ApiVersion retVal = userApi.getServerApiVersion();
retVal = baseAPI.doUser_GetServerApiVersion();

Entitlement: /everyone

Retrieves the API version currently in use.

Function Parameters

This function takes no parameters.

Return value

Type Description
ApiVersion
Types used in this function

ApiVersion

The ApiVersion

Field Type
major String
minor String
micro String

runFilterCubeView

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureCubeResult retVal = userApi.runFilterCubeView(typeURI, scriptURI, filterParams, groupFields, columnFields);
retVal = baseAPI.doUser_RunFilterCubeView(typeURI, scriptURI, filterParams, groupFields, columnFields);

Entitlement: /user/read

Function Parameters

Parameter Type Description
typeURI String
scriptURI String
filterParams String
groupFields String
columnFields String

Return value

Type Description
RaptureCubeResult
Types used in this function

RaptureCubeResult

This is the result of a FilterCubeView.

Field Type
groupNames List
columnNames List
rows List

runNativeQuery

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureQueryResult retVal = userApi.runNativeQuery(typeURI, repoType, queryParams);
retVal = baseAPI.doUser_RunNativeQuery(typeURI, repoType, queryParams);

Entitlement: /user/read

Function Parameters

Parameter Type Description
typeURI String
repoType String
queryParams List

Return value

Type Description
RaptureQueryResult
Types used in this function

RaptureQueryResult

A return value from a native query.

Field Type
rows List

runNativeFilterCubeView

HttpUserApi userApi = new HttpUserApi(loginApi);
RaptureCubeResult retVal = userApi.runNativeFilterCubeView(typeURI, repoType, queryParams, groupFields, columnFields);
retVal = baseAPI.doUser_RunNativeFilterCubeView(typeURI, repoType, queryParams, groupFields, columnFields);

Entitlement: /user/read

Very much like a filter cube view, except that the initial content is taken from a native query executed against a REP repository instead of running through the viewsub system.

Function Parameters

Parameter Type Description
typeURI String
repoType String
queryParams List
groupFields String
columnFields String

Return value

Type Description
RaptureCubeResult
Types used in this function

RaptureCubeResult

This is the result of a FilterCubeView.

Field Type
groupNames List
columnNames List
rows List

isPermitted

HttpUserApi userApi = new HttpUserApi(loginApi);
boolean retVal = userApi.isPermitted(apiCall, callParam);
retVal = baseAPI.doUser_IsPermitted(apiCall, callParam);

Entitlement: /everyone

A method to check whether the current user is allowed to make the API call. Useful for the UI so that it can determine whether or not to show a particular item.

Function Parameters

Parameter Type Description
apiCall String
callParam String

Return value

Type Description
boolean
⚠️ **GitHub.com Fallback** ⚠️