Package com.podio.hook
Class HookAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.hook.HookAPI
-
public class HookAPI extends BaseAPI
-
-
Constructor Summary
Constructors Constructor Description HookAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcreate(Reference object, HookCreate create)Create a new hook on the given object.voiddelete(int id)Deletes the hook with the given id.List<Hook>get(Reference object)Returns the hooks on the object.voidrequestVerification(int id)Request the hook to be validated.voidvalidateVerification(int id, String code)Validates the hook using the code received from the verify call.-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
HookAPI
public HookAPI(ResourceFactory resourceFactory)
-
-
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 oncreate- 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 verifiedcode- The code received from the call to the endpoint
-
-