Isto Intents push notification
The body of a push notification (push profile, draft 0.4), in the Standard Webhooks type/timestamp/data shape. A doorbell: never an offer, a URL, a contact or a code.
$id: https://istointents.org/schemas/0.4/push-event.schema.json
Fields#
| field | type | required | description |
|---|---|---|---|
specVersion | "0.4" | yes | |
type | "intent.matches.delivered" | "intent.status.changed" | "interest.status.changed" | "subscription.verification" | "subscription.ended" | yes | |
timestamp | common › timestamp | yes | |
data | object | yes |
Examples#
- push-event-interest-status valid
- push-event-matches valid
- push-event-verification valid
- push-event-with-intent-code invalid
- push-event-with-offer-url invalid
Full schema#
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://istointents.org/schemas/0.4/push-event.schema.json",
"title": "Isto Intents push notification",
"description": "The body of a push notification (push profile, draft 0.4), in the Standard Webhooks type/timestamp/data shape. A doorbell: never an offer, a URL, a contact or a code.",
"type": "object",
"required": [
"specVersion",
"type",
"timestamp",
"data"
],
"properties": {
"specVersion": {
"const": "0.4"
},
"type": {
"enum": [
"intent.matches.delivered",
"intent.status.changed",
"interest.status.changed",
"subscription.verification",
"subscription.ended"
]
},
"timestamp": {
"$ref": "https://istointents.org/schemas/0.1/common.schema.json#/$defs/timestamp"
},
"data": {
"type": "object"
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "intent.matches.delivered"
}
}
},
"then": {
"properties": {
"data": {
"type": "object",
"required": [
"subscriptionId",
"newMatches",
"latestDeliveredAt"
],
"properties": {
"subscriptionId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,64}$"
},
"newMatches": {
"type": "integer",
"minimum": 1
},
"latestDeliveredAt": {
"$ref": "https://istointents.org/schemas/0.1/common.schema.json#/$defs/timestamp"
}
},
"additionalProperties": false
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "intent.status.changed"
}
}
},
"then": {
"properties": {
"data": {
"type": "object",
"required": [
"subscriptionId",
"status"
],
"properties": {
"subscriptionId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,64}$"
},
"status": {
"enum": [
"awaiting_consent",
"awaiting_email_confirmation",
"active",
"expired",
"withdrawn",
"fulfilled"
]
}
},
"additionalProperties": false
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "interest.status.changed"
}
}
},
"then": {
"properties": {
"data": {
"type": "object",
"required": [
"subscriptionId",
"status"
],
"properties": {
"subscriptionId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,64}$"
},
"status": {
"enum": [
"awaiting_buyer_confirmation",
"sent_to_seller",
"contact_shared",
"seller_declined",
"no_response",
"offer_gone",
"withdrawn",
"expired"
]
}
},
"additionalProperties": false
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "subscription.verification"
}
}
},
"then": {
"properties": {
"data": {
"type": "object",
"required": [
"subscriptionId",
"challenge"
],
"properties": {
"subscriptionId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,64}$"
},
"challenge": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,128}$"
}
},
"additionalProperties": false
}
}
}
},
{
"if": {
"properties": {
"type": {
"const": "subscription.ended"
}
}
},
"then": {
"properties": {
"data": {
"type": "object",
"required": [
"subscriptionId",
"reason"
],
"properties": {
"subscriptionId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{22,64}$"
},
"reason": {
"enum": [
"expired",
"unsubscribed",
"intent-ended",
"approval-withdrawn",
"delivery-failed"
]
}
},
"additionalProperties": false
}
}
}
}
]
}