# Engage Data Drive

Before proceeding with further illustration, it is mandatory to have an API Key for using the SDK. If you don't have a Mailkeets API Key, please refer to this page for instructions on how to generate one.

# Methods

Initialize client as below

    /**
     * Create a unique api key from <a href="https://kursaha.com/engage-data-drive/settings/api-key">API Key</a>.
     * After that, please add that api key into system environment.
     */
    private final String apiKey = System.getenv("KURSAHA_KEY"); // Name of the Environment variable
    private final KursahaClient kursahaClient;
kursahaClient := kursaha.NewKursaha("<YOUR-API-KEY>")

# Signal Start Event

// unique ID for a user, this ID should be constant across the workflow journey
String emitterId = String.valueOf(UUID.randomUUID());

// Eventflow identifier can be found @ https://kursaha.com/engage-data-drive/eventflow
UUID eventflowIdentifier = UUID.fromString("event-flow-identifier");

// Unique id of the step node
String stepNodeId = "start_event";
kursahaClient.edd.signal(eventflowIdentifier, stepNodeId, emitterId);
signal := edd.Signal{
    EmitterID:           "unique-emitter-id",
    StepNodeID:          "step-node-id",
    Data:                map[string]interface{}{},
    EventFlowIdentifier: "uuid",
}
err := client.Edd.SendSignal([]edd.Signal{})
if err != nil {
    print(err.Error())
} else {
    print("successfully send signal!")
}
curl --location 'https://edd.kursaha.com/api/event-flows/signal' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-KEY>' \
--data '{
    "requestIdentifier": "UUID",
    "signals": [
        {
            "emitterId": "UUID",
            "stepNodeId": "step_node_id",
            "data": {
                
            },
            "eventflowIdentifier": "event_flow_id"
        }
    ]
}'

The description for each fields in the signal are as below:

  1. requestIdentifier: Unique UUID to trage the request
  2. signals: Multiple signals can batch in one API call
  3. emitterId: Unique emitter ID, should be unique across the journey of the workflow
  4. stepNodeId: Step node id
  5. data: user data for the specific event
  6. eventflowIdentifier: Event flow identifier

# Sending Customer data to Kursaha

Send your unique customer data to our API using the following endpoint:

  POST https://edd.kursaha.com/api/customers
curl --location 'https://edd.kursaha.com/api/customers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-KEY>' \
--data-raw '{
    "customerId": "<Unique-customer-id>",
    "customerData": {
        "email": "j.doe@swq.com",
        "phoneNumber": "+911002220000",
        "firstName": "John",
        "lastName": "Doe",
        "gender": "",
        "dob":"",
        "city": "",
        "state": "",
        "country": "",
        "zip": ""
    }
}'
// Unique Id of your Customer
String customerId = "<Unique-customer-id>";

// Details of your Customer
CustomerData customerData = new CustomerData();
customerData.setEmail("john.deo@sqs.com");
// ... Please provide all the details of that customer

kursahaClient.edd.sendCustomerData(customerId, customerData);

# Sending Events to Kursaha: Seamlessly Integrate User Data

Effortlessly send multiple events to our API using the following endpoint:

  POST https://edd.kursaha.com/api/event-flows/signal
curl --location 'https://edd.kursaha.com/api/event-flows/signal' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API-KEY>' \
--data-raw '{
    "signals": [
        {
            "customerId": "<Unique-customer-id>",
            "eventType": "<event-type>",
            "data": {
                "price" : 200,
                "brand" : "something",
                "productId": "",
                "category" : "",
                "subCategory1" : "",
                "subCategory2" : "",
                "subCategory3" : ""
            }
        }
    ]
}'

// Coming soon

Here's a breakdown of the fields within the events:

  1. customerId: A distinctive user identifier for precise targeting.
  2. signals: Batch multiple signals in a single API call.
  3. eventType: Specify the event type corresponding to a specific user action.
  4. data: User data associated with the particular event, including attributes price, brand, productId, category, subCategory1, subCategory2, subCategory3 etc.

Leverage this seamless integration to transmit crucial user behavior data to Kursaha, enhancing your customer engagement and acquisition strategies. Connect with your audience like never before!