|
These are the methods that have been included in the Defensio APEX class. defResponseThis is a container object for responses from Defensio's audit-comment call. defStatsResponseThis is a container object for responses from Defensio's stats API call. validateKeyThis is used to test that you can successfully connect and authenticate to the Defensio API auditComment(string sentfromname, string sentfromemail, string bodytext)This is the main method you will use. It submits the content to Defensio, and returns a boolean for whether Defensio considers it spam or not. sentfromnameAn identifier for the trigger of this request. For email, use the From Name field in this. Cannot be null. sentfromemailThis should be an email address you collect from whatever process triggered this method. Do not use a generic email address, and do not use the same email address for every call. Cannot be null. bodytextThis is the content you wish to check. Note, you should not send enormous amounts of text in this field. It will reduce the accuracy of Defensio's decision making process. Successful implementations usually have a max of 1024 characters. reportFalseNegative(string sig)This method is used when you want to tell Defensio it did not mark something as spam that it should have. Exposed as Web Service for flexibility in UI implementation. sigThis is the Defensio signature that was returned with the response of audit-comment. By default, this is inserted with the insertDefinition method, into a custom Salesforce object called Defensio reportFalsePositive(string sig)This method is used when you want to tell Defensio it marked something as spam that it should not have. Exposed as Web Service for flexibility in UI implementation. sigThis is the Defensio signature that was returned with the response of audit-comment. By default, this is inserted with the insertDefinition method, into a custom Salesforce object called Defensio. getDateThis method simply gets the current date, which is needed by audit-comment's processing. insertDefinition(string sig, boolean spam, decimal spaminess, string message, string api, string status, string comment)This method creates a new row in the Defensio custom object, which you can reference later for purposes like retraining Defensio's mistakes. sigThe Defensio signature that was received with audit-comment's response. spamWhether Defensio considered this entry to be spam or not. spaminessThe custom spaminess ranking of the entry. Defensio ranks each entry to allow you to sort by this ranking, allowing for easier retraining. messageAny message that the Defensio API returned. This is typically empty. apiThe API version that Defensio responded with. statusWhether the API call was considered successful or not by Defensio. commentThe comment that was submitted with audit-comment. parseDefensioResponse(string stream)This method interprets the XML stream that Defensio returns for the audit-comment API call. streamThe raw XML stream returned by the Defensio API. getStatsThis method submits an API call to Defensio to get the current stats, and returns that as a string, containing Defensio's data in YAML format. This is typically triggered by a button or link in Salesforce to pop up a javascript alert to the user with the info. Exposed as Web Service for flexibility in UI implementation.
|