Webhook Class
This is a Simplify domain object. In order to get access to a domain object, a client needs to be created. The client is then used to invoke the different methods e.g.
var client = Simplify.getClient({
publicKey: 'YOUR_PUBLIC_API_KEY',
privateKey: 'YOUR_PRIVATE_API_KEY'
});
client.webhook.METHOD_NAME(params, function(error, data){
if(error){
// handle the error
}
// Awesome...no error, handle the data
});
Constructor
Webhook
-
appKeys
Parameters:
-
appKeys
ObjectObject containing the public & private API keys
Methods
create
-
params
-
callback
Function to create a Webhook object.
Parameters:
-
params
ObjectA map of parameters in which to create the Webhook from.
Valid parameters include:- url : Endpoint URL (REQUIRED)
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
delete
-
A
-
callback
Function to delete a Webhook object.
Parameters:
-
A
Objectstring ID of the Webhook to delete.
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
find
-
id
-
callback
Function to retrieve a Webhook object from the API.
Parameters:
-
id
StringThe ID of the Webhook to retrieve
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
list
-
params
-
callback
Function to retrieve a list Webhook objects.
Parameters:
-
params
ObjectA map of parameters in which to define the Webhook list from.
Valid parameters include:- filter : Filters to apply to the list.
- max : Allows up to a max of 50 list items to return. [min value: 0, max value: 50, default: 20]
- offset : Used in paging of the list. This is the start offset of the page. [min value: 0, default: 0]
- sorting : Allows for ascending or descending sorting of the list. The value maps properties to the sort direction (either 'asc' for ascending or 'desc' for descending).
Sortable properties are:- dateCreated
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.
update
-
params
-
callback
Function to update a Webhook object.
Parameters:
-
params
ObjectA map of parameters on which to update the Webhook object.
Valid parameters include:- id : A string ID of the Webhook object to update
- url : Endpoint URL (REQUIRED)
NOTE: Any parameters with a sub-parameter (e.g. param.subParam) need to be nested when passed as an argument in e.g.{ param: { subParam1: 'value', subParam2: 'value' } }
-
callback
FunctionA function to handle success/error responses from the API.
The function takes 2 parameters, the first is an error object. This is null if no error occurs. The second parameter is the response data. This is null if an error occurs.