Class NSWebhookAgent
Webhook definitions* webhooks signal other systems about events inside NetServer.
Syntax
Examples
NSWebhookAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSWebhookAgent()
Webhook definitions* webhooks signal other systems about events inside NetServer.
Declaration
Examples
NSWebhookAgent agent;
agent.callMethod(arg1, arg2);
Methods
CreateDefaultWebhook()
Sets default values into a new NSWebhook.
Declaration
NSWebhook CreateDefaultWebhook()
Returns
Type |
Description |
NSWebhook |
A new NSWebhook with default values.
|
Examples
NSWebhookAgent agent;
NSWebhook thing = agent.CreateDefaultWebhook();
thing = agent.SaveWebhook(thing);
DeleteWebhook(Integer)
Declaration
DeleteWebhook(Integer webhook)
Parameters
Type |
Name |
Description |
Integer |
webhook |
|
Returns
Examples
NSWebhookAgent agent;
agent.DeleteWebhook(123);
GetAllWebhooks(String,String,Integer)
Returns all webhooks, according to filter criteria
Declaration
NSWebhook[] GetAllWebhooks(String nameFilter, String eventFilter, Integer statusFilter)
Parameters
Returns
Examples
NSWebhookAgent agent;
String nameFilter;
String eventFilter;
Integer statusFilter;
NSWebhook[] res = agent.GetAllWebhooks(nameFilter, eventFilter, statusFilter);
GetLastError(Integer)
Return the most recent error message received when calling this webhook.
Declaration
String GetLastError(Integer webhookId)
Parameters
Type |
Name |
Description |
Integer |
webhookId |
|
Returns
Examples
NSWebhookAgent agent;
Integer webhookId;
String res = agent.GetLastError(webhookId);
GetWebhook(Integer)
Gets an NSWebhook object.
Declaration
NSWebhook GetWebhook(Integer webhookId)
Parameters
Type |
Name |
Description |
Integer |
webhookId |
|
Returns
Examples
NSWebhookAgent agent;
NSWebhook thing = agent.GetWebhook(123);
SaveWebhook(NSWebhook)
Updates the existing NSWebhook or creates a new NSWebhook if the id parameter is 0
Declaration
NSWebhook SaveWebhook(NSWebhook webhook)
Parameters
Type |
Name |
Description |
NSWebhook |
webhook |
The NSWebhook to save.
|
Returns
Examples
NSWebhook agent;
NSWebhook thing = agent.CreateDefaultWebhook();
thing = agent.SaveWebhook(thing);
SignalEvent(String,Integer,StringObjectDictionary)
Signal webhooks that an event has occurred. All webhooks listening for the event will be notified.
Declaration
Void SignalEvent(String eventName, Integer primaryKey, StringObjectDictionary data)
Parameters
Returns
Examples
NSWebhookAgent agent;
String eventName;
Integer primaryKey;
StringObjectDictionary data;
agent.SignalEvent(eventName, primaryKey, data);
TestWebhook(NSWebhook)
Pings a webhook with a 'test' event, returns SUCCESS(true) or FAILURE(false) + the response from the webhook target.
Declaration
NSWebhookResult TestWebhook(NSWebhook webhook)
Parameters
Returns
Examples
NSWebhookAgent agent;
NSWebhook webhook;
NSWebhookResult res = agent.TestWebhook(webhook);