Events

The Events endpoint exposes events in your organization. To call this endpoint you will need a public API key (see Authentication).

Request

This endpoint accepts only GET requests.

This endpoint accepts the following parameters:

categoryId: 64 bit integer Id for the Event Category.

Response

An array of all active, published, ongoing or future events in JSON format.

Result Object

[{
  Name: "",
  Description: "",
  EventCode: "",
  ImageUrl: "",
  UrlName: "",
  EventUrl: "",
  RegisterUrl: "",
  Location: "",
  Capacity: null, // 32 bit integer
  StartDate: null, // date/time
  EndDate: null, // date/time
  IsAllDay: false, // boolean
  Address: { 
    Street: "",
    Street2: "",
    City: "",
    State: "",
    Zip: ""
  },
  PointOfContact: { 
    Id: 0, // 64 bit integer
    FullName: "",
    Email: "",
    Phone: "",
    Company: ""
  },
  Tickets: [{
      Name: "",
      Description: "",
      TicketCode: "",
      Amount: null, // floating point
      Quantity: null, // 32 bit integer
      Remaining: null, // 32 bit integer
      MinimumPerOrder: null, // 32 bit integer
      MaximumPerOrder: null, // 32 bit integer
      MaximumPerAttendee: null, // 32 bit integer
      StartDate: null, // date/time
      EndDate: null // date/time
    }],
  Categories: [{
      Name: "",
      Id: 0, //64 bit integer,
      ParentId: null, //64 bit integer,
  }]
}]
Click to copy

Example

This example calls the Events endpoint and displays the number of events returned.

<!DOCTYPE html>
<html>
<head></head>
<body>
<button id="btnLookup">Lookup</button>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>

        $(function () {
            $("#btnLookup").click(function () {
                var api = M3Api().setPublicKey("{API_PUBLIC_KEY}")
                    .setRootUrl("https://mym3domain");

                api.lookupEvents(function (result) {
                    alert(result.length);
                });
            });
        });


        M3Api = function () {
            var self = this;
            self.publicKey = null;
            self.rootUrl = null;
            self.setPublicKey = function (key) {
                self.publicKey = key;
                return self;
            }
            self.setRootUrl = function (url) {
                self.rootUrl = url;
                return self;
            }
            self.lookupEvents = function (callback) {
                $.ajax({
                    type: "GET",
                    url: rootUrl + "/Api/V2/Events",
                    dataType: 'json',
                    headers: {
                        Authorization: "ApiPublic " + self.publicKey,
                        Accept: "application/json"
                    },
                    success: function (data) {
                        callback(data);
                    }
                });
            }
            return self;
        };

    </script>
</body>
</html>
Click to copy