These are important events occurring in the application, and which are reported back to the Emarsys Automation Center. When Mobile Engage logs an event to the event table, it will update the last mobile activity date. The hardware ID and a timestamp of the custom event are stored in an empty object.

Endpoint

POST https://push.eservice.emarsys.net/api/mobileengage/v2/events/<name>

Example

{
"application_id": "F661E-162A6",
"hardware_id": "61C53F6F-4E93-46C0-9E67-83768B371CEB"
}

Responses

Status code Meaning
201 Created.
500 Database error (Everything else).

Calling this from iOS

var parameters: [String:AnyObject] = [String:AnyObject]()

parameters["application_id"] = APPLICATION_ID
parameters["hardware_id"] = HWID

let url = NSURL(string: API_EVENT_ROUTE + " (eventName)")

Calling this from Android

public int event(String event, JSONObject data){

try {
  endpoint = new URL("https://push.eservice.emarsys.net/api/mobileengage/v2/events/<name>");
} catch (MalformedURLException e) {
  e.printStackTrace();
}

postdata = new JSONObject();

try {
  postdata.put("application_id", app_id);
  postdata.put("hardware_id", android_id);

  if (data != null)
  {
    postdata.put("attributes", data);
  }

} catch (JSONException e) {
  e.printStackTrace();
}

//  Send HTTP Request with payload
// return status
...
  }