projects.apps.events

Overview

The Events API allows you to create lending events tied to existing app user accounts such as borrowers.

{
   "accountId": string,
   "eventType": string,
   "timestamp": string,
   "data": [
      {
         object(EntityValueSet)
      }
   ]
}

Fields

Field

Data Type

Description

accountId

string

Required

Unique id that identifies an account type and account id in the form <ACCOUNT_TYPE>:<ACCOUNT_ID>.

For example a borrower with a borrowerId 10023 will have an account id with the value borrower:10023.

Read-only after creation

eventId

string

Required Used in responses only.

UUID that identifies an event. It is generated from the accountId, eventType and timestamp. Used in responses only.

Read-only after creation

eventType

string

( ‘personal_data.captured’ )

Required The type of event.

Read-only

timestamp

string

( Timestamp format )

Required

The event timestamp as captured on your lending app in ISO format.

Example: 2019-05-12T12:00:55+03:00

Read-only after creation

status

number

Event status. The values are described below.

Used in responses only.

The status descriptions are outlined below.

0: not processed

1: processed successfully

2: processed with errors

Read-only

data [ ]

object

( EntityValueSet )

Array of data sets.

Read-only after creation

appVersionId

string

The lending app versionId used to process this event. Read more about app versions here.

Example: v1

Read-only

category

string | null

The event's data category.

Use this when sending homogeneous entity data that you would want to track later. For instance, if you wanted to search for the last time SMS data was captured for a borrower. Categories map to entity data types. Valid categories are as follows.

  • sms

  • contact

Added 04-September-2020.

Read-only after creation

List

GET https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/events

List all lending events for a lending app.

Path Parameters

NameTypeDescription

projectId

string

Id of the weza.io project.

appId

string

Id of the lending app.

Query Parameters

NameTypeDescription

pageSize

string

Maximum events to return defaults to 1000.

pageToken

string

The nextPageToken value from the previous list call. Remember to encode it.

filter

string

An expression to filter the results of the request. The eligible filter fields are. - accountId - eventType - timestamp - status - appVersionId - category

order

string

Describes how to order the results. The value can be asc or desc. Defaults to asc.

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

The request body should be empty.

Response Body

If successful, the response will contain data with the following structure.

{
  "events": [
    {
      object(LendingEvent)
    }
  ],
  "nextPageToken": string,
}

Fields

Field

Data Type

Description

events[]

object(LendingEvent)

A list of lending event instances.

nextPageToken

string

Token to use to fetch the next page of data if any.

Authorization

Requires any one of the following OAuth scopes:

  • platform

  • platform.lending

  • platform.lending:read

The authenticated user must have the lending.events.list permission.

Create

POST https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/events

Create an event if one doesn't exist. An event is uniquely identified by using its accountId, eventType and timestamp. This method will throw a 409 HTTP error if you try to create an already existing event resource based on the above criteria. See the Errors section for more details.

Path Parameters

NameTypeDescription

projectId

string

Id of the weza.io project

appId

string

Id of the lending app

Headers

NameTypeDescription

Authorization

string

Bearer token

{
   "accountId": string,
   "eventType": string,
   "timestamp": string,
   "data": [
      {
         object(EntityValueSet)
      }
   ]
}

Request Body

The request body contains an instance of LendingEvent.

Response Body

The response body contains a new instance of LendingEvent.

Authorization

Requires one of the following OAuth scopes:

  • platform.lending

  • platform.lending:write

The authenticated user must have the lending.events.create permission.

Last updated