Get Events

Please read the Events API Guide in advance of using this API.

The Tola Events endpoint will allow you to fetch all transactions which have been completed for your application via the Tola Wallet platform

Query Parameters
  • last_event
    Type: string

    This value acts as a pointer into the event stream, indicating the event_id from where to resume retrieval from. Typically you should pass in the last_event you received in the previous event stream response. When you provide this, only events that occurred after the specified event are returned.

    When not supplied, the oldest page of events are returned. This parameter cannot be used together with the not_older_than argument in the same query.

  • not_older_than
    Type: integer

    Returns the oldest events that are not older than the specified number of seconds. This can not be used in conjunction with the last_event argument in the same query. Note that this should not be used as part of routine automated event pulling, use 'last_event' for that.

  • long_poll
    Type: integer

    Number of seconds you want the server to wait before returning an empty result. Once events are available it will return immediately. Must be between 15 and 60 seconds inclusive.

Responses
  • application/json
Request Example for get/events
curl https://wallet-mock.tolamobile.com/events \
  --header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
{
  "events": [
    {
      "metadata": {
        "event_id": "1.106.1692926344.8",
        "webhook_delivered": true,
        "payload_format": "mobile-money"
      },
      "payload": {
        "reference": "1.106.1692926344.9",
        "accountname": "string",
        "amount": "10000",
        "amounttype": "centile",
        "campaignid": "10001",
        "channel": "KENYA.SAFARICOM",
        "currency": "KES",
        "customerreference": "8FD2KuZNJnBPLKmz",
        "date": "2023-08-25T01:19:04Z",
        "mac": "string",
        "msisdn": "254000000001",
        "operatorreference": "OP123456",
        "sourcereference": "1.106.1692926344.8",
        "success": "true",
        "target": "000001",
        "type": "notification"
      }
    }
  ],
  "last_event": "1.106.1692926344.8",
  "last_event_time": "2023-08-25T01:19:04Z",
  "num_rows": 1,
  "success": true
}