public class UserApiKeys extends Object
Constructor and Description |
---|
UserApiKeys(String userId) |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteKey(long id,
String secret)
Deletes an api key
|
Results<AccessKey> |
getKeys(int limit,
int offset,
String sortField,
boolean asc,
boolean getAvailable)
Retrieves either list of available keys for current user or all keys.
|
AccessKey |
requestKey(String clientId)
Generates an access key using the client identifier
|
public UserApiKeys(String userId)
public AccessKey requestKey(String clientId)
clientId
- unique client identifier.The api token that is generated and returned to the user is not stored and therefore cannot be retrieved. If lost, the api key record can be deleted by the user who created it (or an admin) and a new one created.
public Results<AccessKey> getKeys(int limit, int offset, String sortField, boolean asc, boolean getAvailable)
limit
- maximum number of keys to retrieveoffset
- paging parameter startsortField
- field to sort onasc
- whether the retrieve order is in ascending ordergetAvailable
- whether to retrieve all available keys or restrict by current userPermissionException
- if getAvailable
is true but user making the request does not have
administrative privilegespublic boolean deleteKey(long id, String secret)
id
- unique database identifier for the keysecret
- unique key secretPermissionException
- if the key being deleted does not belong to user and user does not have
administrative privilegesCopyright © 2017. All rights reserved.