My favorites | Sign in
Project Logo
                
Search
for
Updated Aug 29, 2008 by paul.mcgurn
Labels: Featured
Methods  

These are the methods that have been included in the Defensio APEX class.

defResponse

This is a container object for responses from Defensio's audit-comment call.

defStatsResponse

This is a container object for responses from Defensio's stats API call.

validateKey

This 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.

sentfromname

An identifier for the trigger of this request. For email, use the From Name field in this. Cannot be null.

sentfromemail

This 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.

bodytext

This 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.

sig

This 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.

sig

This 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.

getDate

This 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.

sig

The Defensio signature that was received with audit-comment's response.

spam

Whether Defensio considered this entry to be spam or not.

spaminess

The custom spaminess ranking of the entry. Defensio ranks each entry to allow you to sort by this ranking, allowing for easier retraining.

message

Any message that the Defensio API returned. This is typically empty.

api

The API version that Defensio responded with.

status

Whether the API call was considered successful or not by Defensio.

comment

The 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.

stream

The raw XML stream returned by the Defensio API.

getStats

This 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.


Sign in to add a comment
Hosted by Google Code