Field guide

 
Name
Type
Parameters
Rules
BeginWorker
Class
App ID and License Key
Only class publicly available on the SDK Must be a Singleton
registerUser
Method
ID unique to the application using the SDK
The ID must be unique in the SDK stored dataset. If a duplicated ID is provided, the SDK must just ignore it If an ID is not provided, the SDK must return an error
registerObject
Method
Object type & object ID
An Object can have N IDs associated with it. If a duplicated ID is provided for an Object, the SDK must just ignore it If one of the parameters are not provided, the SDK must return an error
updateUserDateField
Method
User ID, Field name & date
SDK will internally format the Date provided to %d-%m-%Y The field name & formatted date will be stored in the SDK under the User associated User ID If the field name already exists, the value must be updated If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the User first If one of the parameters are not provided, the SDK must return an error
updateUserTextField
Method
User ID, Field name & value
The field name & value will be stored in the SDK under the User associated User ID If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the object first If the field name already exists, the value must be updated If one of the parameters are not provided, the SDK must return an error
updateUserNumericalField
Method
User ID, Field name & numerical value
The field name & value will be stored in the SDK under the User associated User ID If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the object first If the field name already exists, the value must be updated If one of the parameters are not provided, the SDK must return an error
updateUserLocationField
Method
User ID, Field name & latitude/longitude
The SDK will internally format the latitude/longitude provide as an object containing both values and have that object stored The field name & formatted object will be stored in the SDK under the User associated User ID If the ID provided doesn’t exist for the user provided then the SDK must raise an error informing the user that they must register the object first If the field name already exists, the value must be updated If one of the parameters are not provided, the SDK must return an error
updateObjectTextField
Method
Object name, object ID, field & value
The SDK will store the field & value provided for the specific object ID provided under the object name If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the object first If one of the parameters are not provided, the SDK must return an error
updateObjectDateField
Method
Object name, object ID, field & date
SDK will internally format the Date provided to %d-%m-%Y The SDK will store the field & date provided for the specific object ID provided under the object name If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the object first If one of the parameters are not provided, the SDK must return an error
updateObjectNumericalField
Method
Object name, object ID, field & numerical value
The SDK will store the field & value provided for the specific object ID provided under the object name If the ID provided doesn’t exist for the object name provided then the SDK must raise an error informing the user that they must register the object first If one of the parameters are not provided, the SDK must return an error
registerInteraction
Method
User ID, object name, action, object ID
The SDK will store the action provided for the user ID on the associated object ID and object name under the interactions object An object ID can have multiple interactions (and they can be the same action) A user ID can have multiple interactions. If one of the parameters are not provided, the SDK must return an error
addLabel
Method
Object name, Object ID, label
The SDK will store the label in a list of labels associated to the specific object and object ID provided. If the Object name and Object ID provided doesn’t exist on the stored data, then the SDK must raise an error informing the user that they must register the object/object id first If one of the parameters are not provided, the SDK must return an error
learnFromData
Method
Fetches the latest instructions available for the App ID provided Apply the instructions to the collected data set Sends the generated signature to Begin’s API Removes any data stored in the SDK NOTE: For details regarding the API endpoints visit
predictEngagement
Method
Predict Engagement Project ID, User ID, Object ID
Sends a request to Begin’s API with a Project ID, User ID, and Object ID. Provides back to the SDK User one of the following options: * INTERACTS_NEGATIVE * INTERACTS_POSITIVE * INTERACTS_NEUTRAL * NOT_FOUND → in case the API returns 404, the SDK must use NOT_FOUND as the returned value NOTE: For details regarding the API endpoints visit
recommend
Method
Recommend Project ID, User ID, Limit (optional), Page (optional)
Sends a request to Begin’s API with a Project ID, User ID and Limit/Page (if provided) Provides back to the SDK User a list of recommended Object IDs. In case no recommendation is available, provides an empty list NOTE: In case a limit/page is not provided, the API defaults to the top 20 results NOTE: For details regarding the API endpoints visit
classify
Method
Classify Project ID, Object ID
Sends a request to Begin’s API with a Project ID and Object ID Provides back to the SDK User a classification label for the provided object. In case the API returns 404, the SDK must use NOT_FOUND as the returned value NOTE: For details regarding the API endpoints visit
fake_detect
Method
Fake Detection Project ID, Object ID
Sends a request to Begin’s API with a Project ID and Object ID Provides back to the SDK User a label for the provided object. In case the API returns 404, the SDK must use NOT_FOUND as the returned value NOTE: For details regarding the API endpoints visit