RailzwayDocs
API referenceFare API v1

Usage ingestion

POST
/v1/usageEvents:ingest

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/usageEvents:ingest" \  -H "Content-Type: application/json" \  -d '{    "event": {      "customer": "string",      "eventId": "string",      "eventTime": "2019-08-24T14:15:22Z",      "eventType": "string"    },    "parent": "string"  }'
{  "errorCode": "string",  "errorMessage": "string",  "eventId": "string",  "status": "INGESTION_STATUS_UNSPECIFIED",  "usageEvent": "string"}
POST
/v1/usageEvents:batchIngest

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/usageEvents:batchIngest" \  -H "Content-Type: application/json" \  -d '{    "events": [      {        "customer": "string",        "eventId": "string",        "eventTime": "2019-08-24T14:15:22Z",        "eventType": "string"      }    ],    "parent": "string"  }'
{  "results": [    {      "errorCode": "string",      "errorMessage": "string",      "eventId": "string",      "status": "INGESTION_STATUS_UNSPECIFIED",      "usageEvent": "string"    }  ]}
GET
/v1/usageEvents/{name}

Path Parameters

name*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/usageEvents/string"
{  "correctionOf": "string",  "customer": "string",  "eventId": "string",  "eventTime": "2019-08-24T14:15:22Z",  "eventType": "string",  "ingestTime": "2019-08-24T14:15:22Z",  "name": "string",  "properties": {},  "status": "INGESTION_STATUS_UNSPECIFIED"}
GET
/v1/usageEvents

Query Parameters

pageSize?integer
Formatint32
pageToken?string
eventType?string
startTime?string
Formatdate-time
endTime?string
Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/usageEvents"
{  "events": [    {      "correctionOf": "string",      "customer": "string",      "eventId": "string",      "eventTime": "2019-08-24T14:15:22Z",      "eventType": "string",      "ingestTime": "2019-08-24T14:15:22Z",      "name": "string",      "properties": {},      "status": "INGESTION_STATUS_UNSPECIFIED"    }  ],  "nextPageToken": "string"}
POST
/v1/usageEvents/{name}:correct

Path Parameters

name*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/usageEvents/string:correct" \  -H "Content-Type: application/json" \  -d '{    "reason": "string",    "replacement": {      "customer": "string",      "eventId": "string",      "eventTime": "2019-08-24T14:15:22Z",      "eventType": "string"    }  }'
{  "correctionOf": "string",  "customer": "string",  "eventId": "string",  "eventTime": "2019-08-24T14:15:22Z",  "eventType": "string",  "ingestTime": "2019-08-24T14:15:22Z",  "name": "string",  "properties": {},  "status": "INGESTION_STATUS_UNSPECIFIED"}
POST
/v1/usageEvents:replay

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/usageEvents:replay" \  -H "Content-Type: application/json" \  -d '{    "endTime": "2019-08-24T14:15:22Z",    "parent": "string",    "startTime": "2019-08-24T14:15:22Z"  }'
{  "matchedEventCount": "string",  "replayId": "string",  "watermarkTime": "2019-08-24T14:15:22Z"}