Class HookAPI


  • public class HookAPI
    extends BaseAPI
    • Method Detail

      • create

        public int create​(Reference object,
                          HookCreate create)
        Create a new hook on the given object.
        Parameters:
        object - The reference to the object the hook should be created on
        create - The details for the new hook
        Returns:
        The id of the newly created hook
      • delete

        public void delete​(int id)
        Deletes the hook with the given id.
        Parameters:
        id - The id of the hook
      • get

        public List<Hook> get​(Reference object)
        Returns the hooks on the object.
        Parameters:
        object - The reference to the object to get hooks for
        Returns:
        The list of hooks on the object
      • requestVerification

        public void requestVerification​(int id)
        Request the hook to be validated. This will cause the hook to send a request to the URL with the parameter "type" set to "hook.verify" and "code" set to the verification code. The endpoint must then call the validate method with the code to complete the verification.
        Parameters:
        id - The id of the hook to be verified
      • validateVerification

        public void validateVerification​(int id,
                                         String code)
        Validates the hook using the code received from the verify call. On successful validation the hook will become active.
        Parameters:
        id - The id of the hook to be verified
        code - The code received from the call to the endpoint