Class ApiKeyService

java.lang.Object
com.easypost.service.ApiKeyService

public class ApiKeyService extends Object
  • Method Details

    • retrieveApiKeysForUser

      public List<ApiKey> retrieveApiKeysForUser(String id) throws EasyPostException
      Get this User's API keys.
      Parameters:
      id - The ID of the user.
      Returns:
      List of ApiKey objects.
      Throws:
      EasyPostException - when the request fails.
    • all

      public ApiKeys all() throws EasyPostException
      Get all API keys.
      Returns:
      ApiKeys object.
      Throws:
      EasyPostException - when the request fails.
    • create

      public ApiKey create(String mode) throws EasyPostException
      Create an API key for a child or referral customer user.
      Parameters:
      mode - The mode of the API key (production or test).
      Returns:
      ApiKey object.
      Throws:
      EasyPostException - when the request fails.
    • delete

      public void delete(String id) throws EasyPostException
      Delete an API key for a child or referral customer user.
      Parameters:
      id - The ID of the API key to delete.
      Throws:
      EasyPostException - when the request fails.
    • enable

      public ApiKey enable(String id) throws EasyPostException
      Enable a child or referral customer API key.
      Parameters:
      id - The ID of the API key to enable.
      Returns:
      ApiKey object.
      Throws:
      EasyPostException - when the request fails.
    • disable

      public ApiKey disable(String id) throws EasyPostException
      Disable a child or referral customer API key.
      Parameters:
      id - The ID of the API key to disable.
      Returns:
      ApiKey object.
      Throws:
      EasyPostException - when the request fails.