Package io.mailtrap.api.apitokens
Interface ApiTokens
- All Known Implementing Classes:
ApiTokensImpl
public interface ApiTokens
-
Method Summary
Modifier and TypeMethodDescriptioncreateApiToken(long accountId, CreateApiTokenRequest request) Create a new API token for the account with the given name and resource permissions.voiddeleteApiToken(long accountId, long id) Permanently delete an API token.getAllApiTokens(long accountId) List all API tokens visible to the current API token.getApiToken(long accountId, long id) Get a single API token by id.resetApiToken(long accountId, long id) Reset an API token.
-
Method Details
-
getAllApiTokens
List all API tokens visible to the current API token.- Parameters:
accountId- unique account ID- Returns:
- list of API tokens
-
createApiToken
Create a new API token for the account with the given name and resource permissions. The full token value is returned only on creation.- Parameters:
accountId- unique account IDrequest- token name and resource permissions- Returns:
- created token, including the full token value
-
getApiToken
Get a single API token by id.- Parameters:
accountId- unique account IDid- API token ID- Returns:
- API token
-
deleteApiToken
void deleteApiToken(long accountId, long id) Permanently delete an API token.- Parameters:
accountId- unique account IDid- API token ID
-
resetApiToken
Reset an API token. Expires the requested token and creates a new one with the same permissions; the new token value is returned only once.- Parameters:
accountId- unique account IDid- API token ID- Returns:
- new token, including the full token value
-