Skip to main content

AsyncAPI for campaign service 0.0.1 documentation

info

In this document, PUB means "publish" and SUB means "subscribe". This refers to the "publish/subscribe" (pub/sub) messaging framework, where "publish" means that the service sends data to Kafka topics, and "subscribe" means the service acts as a consumer that subscribes to specific Kafka topics to receive data.

Table of Contents

Operations

PUB campaignManagement Operation

Accepts one of the following messages:

Message campaignCreated

message is sent when campaign is created

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.campaignobject---additional properties are allowed
payload.campaign.idstringcampaign id---
payload.campaign.typestringcampaign typeallowed ("REDEMPTION")--
payload.campaign.namespacestringnamespace of this campaign---
payload.campaign.namestringname of this campaign---
payload.campaign.descriptionstringdescription of this campaign---
payload.campaign.tagsarray<string>tags of this campaign---
payload.campaign.tags (single item)string----
payload.campaign.statusstringstatus of this campaignallowed ("ACTIVE", "INACTIVE")--
payload.campaign.redeemStartstringredeem start time-format (date-time)-
payload.campaign.redeemEndstringredeem end time-format (date-time)-
payload.campaign.maxRedeemCountPerCodeintegermax redeem count per code, -1 means UNLIMITED-format (int32)-
payload.campaign.maxRedeemCountPerCodePerUserintegermax redeem count per code per user, -1 mean UNLIMITED-format (int32)-
payload.campaign.maxRedeemCountPerCampaignPerUserintegermax redeem count per campaign per user, -1 mean UNLIMITED-format (int32)-
payload.campaign.maxSaleCountintegermax sale count, -1 mean UNLIMITED-format (int32)-
payload.campaign.redeemTypestringredeem typeallowed ("ITEM")--
payload.campaign.itemsarray<object>----
payload.campaign.items.itemIdstringThe redeemable item id--required
payload.campaign.items.itemNamestringThe redeemable item name--required
payload.campaign.items.quantityintegerThe redeemable item quantity, 1 for default-format (int32)-
payload.campaign.items.extraSubscriptionDaysintegerExtra subscription days if the item is a subscription, 0 by default-format (int32)-
payload.campaign.boothNamestringbooth name for sale---
payload.campaign.createdAtstringtime when campaign is created-format (date-time)-
payload.campaign.updatedAtstringtime when campaign is updated-format (date-time)-
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"campaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message campaignUpdated

message is sent when campaign is updated

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.campaignobject---additional properties are allowed
payload.campaign.idstringcampaign id---
payload.campaign.typestringcampaign typeallowed ("REDEMPTION")--
payload.campaign.namespacestringnamespace of this campaign---
payload.campaign.namestringname of this campaign---
payload.campaign.descriptionstringdescription of this campaign---
payload.campaign.tagsarray<string>tags of this campaign---
payload.campaign.tags (single item)string----
payload.campaign.statusstringstatus of this campaignallowed ("ACTIVE", "INACTIVE")--
payload.campaign.redeemStartstringredeem start time-format (date-time)-
payload.campaign.redeemEndstringredeem end time-format (date-time)-
payload.campaign.maxRedeemCountPerCodeintegermax redeem count per code, -1 means UNLIMITED-format (int32)-
payload.campaign.maxRedeemCountPerCodePerUserintegermax redeem count per code per user, -1 mean UNLIMITED-format (int32)-
payload.campaign.maxRedeemCountPerCampaignPerUserintegermax redeem count per campaign per user, -1 mean UNLIMITED-format (int32)-
payload.campaign.maxSaleCountintegermax sale count, -1 mean UNLIMITED-format (int32)-
payload.campaign.redeemTypestringredeem typeallowed ("ITEM")--
payload.campaign.itemsarray<object>----
payload.campaign.items.itemIdstringThe redeemable item id--required
payload.campaign.items.itemNamestringThe redeemable item name--required
payload.campaign.items.quantityintegerThe redeemable item quantity, 1 for default-format (int32)-
payload.campaign.items.extraSubscriptionDaysintegerExtra subscription days if the item is a subscription, 0 by default-format (int32)-
payload.campaign.boothNamestringbooth name for sale---
payload.campaign.createdAtstringtime when campaign is created-format (date-time)-
payload.campaign.updatedAtstringtime when campaign is updated-format (date-time)-
payload.oldCampaignobject---additional properties are allowed
payload.oldCampaign.idstringcampaign id---
payload.oldCampaign.typestringcampaign typeallowed ("REDEMPTION")--
payload.oldCampaign.namespacestringnamespace of this campaign---
payload.oldCampaign.namestringname of this campaign---
payload.oldCampaign.descriptionstringdescription of this campaign---
payload.oldCampaign.tagsarray<string>tags of this campaign---
payload.oldCampaign.tags (single item)string----
payload.oldCampaign.statusstringstatus of this campaignallowed ("ACTIVE", "INACTIVE")--
payload.oldCampaign.redeemStartstringredeem start time-format (date-time)-
payload.oldCampaign.redeemEndstringredeem end time-format (date-time)-
payload.oldCampaign.maxRedeemCountPerCodeintegermax redeem count per code, -1 means UNLIMITED-format (int32)-
payload.oldCampaign.maxRedeemCountPerCodePerUserintegermax redeem count per code per user, -1 mean UNLIMITED-format (int32)-
payload.oldCampaign.maxRedeemCountPerCampaignPerUserintegermax redeem count per campaign per user, -1 mean UNLIMITED-format (int32)-
payload.oldCampaign.maxSaleCountintegermax sale count, -1 mean UNLIMITED-format (int32)-
payload.oldCampaign.redeemTypestringredeem typeallowed ("ITEM")--
payload.oldCampaign.itemsarray<object>----
payload.oldCampaign.items.itemIdstringThe redeemable item id--required
payload.oldCampaign.items.itemNamestringThe redeemable item name--required
payload.oldCampaign.items.quantityintegerThe redeemable item quantity, 1 for default-format (int32)-
payload.oldCampaign.items.extraSubscriptionDaysintegerExtra subscription days if the item is a subscription, 0 by default-format (int32)-
payload.oldCampaign.boothNamestringbooth name for sale---
payload.oldCampaign.createdAtstringtime when campaign is created-format (date-time)-
payload.oldCampaign.updatedAtstringtime when campaign is updated-format (date-time)-
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"campaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"oldCampaign": {
"id": "string",
"type": "REDEMPTION",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"redeemStart": "2019-08-24T14:15:22Z",
"redeemEnd": "2019-08-24T14:15:22Z",
"maxRedeemCountPerCode": 0,
"maxRedeemCountPerCodePerUser": 0,
"maxRedeemCountPerCampaignPerUser": 0,
"maxSaleCount": 0,
"redeemType": "ITEM",
"items": [
{
"itemId": "string",
"itemName": "string",
"quantity": 0,
"extraSubscriptionDays": 0
}
],
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message codeCreated

message is when redeem codes are created

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeCreateobject---additional properties are allowed
payload.codeCreate.campaignIdstringcampaign id of the code belong to---
payload.codeCreate.campaignNamestringthe campaign name---
payload.codeCreate.quantityintegerquantity of code created---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeCreate": {
"campaignId": "string",
"campaignName": "string",
"quantity": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message codeDisabled

message is sent when code is disabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeConditionobject---additional properties are allowed
payload.codeCondition.campaignIdstringcampaign id of the codes belong to---
payload.codeCondition.batchNointegercode batch number---
payload.codeCondition.valuestringcode value---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message codeEnabled

message is sent when redeem code is enabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeConditionobject---additional properties are allowed
payload.codeCondition.campaignIdstringcampaign id of the codes belong to---
payload.codeCondition.batchNointegercode batch number---
payload.codeCondition.valuestringcode value---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message codeBulkDisabled

message is sent when bulk codes are disabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeConditionobject---additional properties are allowed
payload.codeCondition.campaignIdstringcampaign id of the codes belong to---
payload.codeCondition.batchNointegercode batch number---
payload.codeCondition.valuestringcode value---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message codeBulkEnabled

message is sent when bulk codes are enabled

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeConditionobject---additional properties are allowed
payload.codeCondition.campaignIdstringcampaign id of the codes belong to---
payload.codeCondition.batchNointegercode batch number---
payload.codeCondition.valuestringcode value---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeCondition": {
"campaignId": "string",
"batchNo": 0,
"value": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

PUB keyGroupManagement Operation

Accepts one of the following messages:

Message keyGroupCreated

message is sent when key group is created

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.keyGroupobject---additional properties are allowed
payload.keyGroup.idstringkey group id---
payload.keyGroup.namespacestringnamespace of this key group---
payload.keyGroup.namestringname of key group---
payload.keyGroup.descriptionstringdescription of key group---
payload.keyGroup.tagsarray<string>tags of key group---
payload.keyGroup.tags (single item)string----
payload.keyGroup.statusstringstatus of key groupallowed ("ACTIVE", "INACTIVE")--
payload.keyGroup.boothNamestringbooth name for sale---
payload.keyGroup.createdAtstringtime when key group was created-format (date-time)-
payload.keyGroup.updatedAtstringtime when key group was updated-format (date-time)-
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"keyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message keyGroupUpdated

message is sent when key group is updated

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.keyGroupobject---additional properties are allowed
payload.keyGroup.idstringkey group id---
payload.keyGroup.namespacestringnamespace of this key group---
payload.keyGroup.namestringname of key group---
payload.keyGroup.descriptionstringdescription of key group---
payload.keyGroup.tagsarray<string>tags of key group---
payload.keyGroup.tags (single item)string----
payload.keyGroup.statusstringstatus of key groupallowed ("ACTIVE", "INACTIVE")--
payload.keyGroup.boothNamestringbooth name for sale---
payload.keyGroup.createdAtstringtime when key group was created-format (date-time)-
payload.keyGroup.updatedAtstringtime when key group was updated-format (date-time)-
payload.oldKeyGroupobject---additional properties are allowed
payload.oldKeyGroup.idstringkey group id---
payload.oldKeyGroup.namespacestringnamespace of this key group---
payload.oldKeyGroup.namestringname of key group---
payload.oldKeyGroup.descriptionstringdescription of key group---
payload.oldKeyGroup.tagsarray<string>tags of key group---
payload.oldKeyGroup.tags (single item)string----
payload.oldKeyGroup.statusstringstatus of key groupallowed ("ACTIVE", "INACTIVE")--
payload.oldKeyGroup.boothNamestringbooth name for sale---
payload.oldKeyGroup.createdAtstringtime when key group was created-format (date-time)-
payload.oldKeyGroup.updatedAtstringtime when key group was updated-format (date-time)-
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"keyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"oldKeyGroup": {
"id": "string",
"namespace": "string",
"name": "string",
"description": "string",
"tags": [
"string"
],
"status": "ACTIVE",
"boothName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

Message keyUploaded

message is sent when upload keys

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.keyUploadobject---additional properties are allowed
payload.keyUpload.keyGroupIdstringkey group id---
payload.keyUpload.keyGroupNamestringthe key group name---
payload.keyUpload.quantityintegerquantity of key uploaded---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"keyUpload": {
"keyGroupId": "string",
"keyGroupName": "string",
"quantity": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

PUB codeRedemption Operation

Message codeRedeemed

message is sent when code is redeemed

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.codeRedemptionobject---additional properties are allowed
payload.codeRedemption.userIdstringuser id---
payload.codeRedemption.campaignIdstringthe campaign id---
payload.codeRedemption.campaignNamestringthe campaign name---
payload.codeRedemption.codestringthe code value---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"codeRedemption": {
"userId": "string",
"campaignId": "string",
"campaignName": "string",
"code": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}

PUB ticketSale Operation

Message ticketAcquired

message is sent when ticket is acquired, for example, when user buy a code type item

Payload
NameTypeDescriptionValueConstraintsNotes
(root)object allOf---additional properties are allowed
payloadobject---additional properties are allowed
payload.ticketAcquisitionobject---additional properties are allowed
payload.ticketAcquisition.userIdstringuser id---
payload.ticketAcquisition.boothNamestringbooth name---
payload.ticketAcquisition.countintegerpurchase count---
payload.ticketAcquisition.orderNostringorder no---
0 (allOf item)object---additional properties are allowed
idstringevent id---
versioninteger----
namestringevent name---
namespacestringevent namespace---
parentNamespacestring----
timestampstring--format (date-time)-
clientIdstringclient id---
userIdstringthe operator id---
traceIdstringtrace id---
sessionIdstringsession id---

Examples of payload (generated)

{
"payload": {
"ticketAcquisition": {
"userId": "string",
"boothName": "string",
"count": 0,
"orderNo": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}