Custom Events are application behavior events you want to know of, collect and store, to create segments on them later.

You have to specify the name of the custom event, and send it to Mobile Engage – we will store which device and application the event was sent from and when – and this will be available for segmentation later.

For more information on segmentation based on custom events, see Mobile Engage Segmentation.

If you wish to send attributes with the event, please contact Emarsys support.

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