Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add com.delighted schemas #660

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions jsonpaths/com.delighted/survey_response_created_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"jsonpaths": [
"$.schema.vendor",
"$.schema.name",
"$.schema.format",
"$.schema.version",
"$.hierarchy.rootId",
"$.hierarchy.rootTstamp",
"$.hierarchy.refRoot",
"$.hierarchy.refTree",
"$.hierarchy.refParent",
"$.data.event_data.comment",
"$.data.event_data.created_at",
"$.data.event_data.id",
"$.data.event_data.notes",
"$.data.event_data.permalink",
"$.data.event_data.person.created_at",
"$.data.event_data.person.email",
"$.data.event_data.person.id",
"$.data.event_data.person.name",
"$.data.event_data.person.phone_number",
"$.data.event_data.person_properties.Browser",
"$.data.event_data.person_properties.Country",
"$.data.event_data.person_properties.Device Type",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure there's a good reason for going with these property names, but the spaces make me very nervous. How difficult would it be to conform them to the rest of the fields, like device_type or user_agent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment unfortunately the webhook sends these fields through with spaces so without an adapter we're stuck with the spaces.

"$.data.event_data.person_properties.IP Address",
"$.data.event_data.person_properties.Operating System",
"$.data.event_data.person_properties.Page",
"$.data.event_data.person_properties.Page URL",
"$.data.event_data.person_properties.Referrer URL",
"$.data.event_data.person_properties.User Agent",
"$.data.event_data.person_properties.delighted_source",
"$.data.event_data.person_properties.user_id",
"$.data.event_data.score",
"$.data.event_data.survey_type",
"$.data.event_data.tags",
"$.data.event_data.updated_at",
"$.data.event_id",
"$.data.event_type"
]
}
40 changes: 40 additions & 0 deletions jsonpaths/com.delighted/survey_response_updated_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"jsonpaths": [
"$.schema.vendor",
"$.schema.name",
"$.schema.format",
"$.schema.version",
"$.hierarchy.rootId",
"$.hierarchy.rootTstamp",
"$.hierarchy.refRoot",
"$.hierarchy.refTree",
"$.hierarchy.refParent",
"$.data.event_data.comment",
"$.data.event_data.created_at",
"$.data.event_data.id",
"$.data.event_data.notes",
"$.data.event_data.permalink",
"$.data.event_data.person.created_at",
"$.data.event_data.person.email",
"$.data.event_data.person.id",
"$.data.event_data.person.name",
"$.data.event_data.person.phone_number",
"$.data.event_data.person_properties.Browser",
"$.data.event_data.person_properties.Country",
"$.data.event_data.person_properties.Device Type",
"$.data.event_data.person_properties.IP Address",
"$.data.event_data.person_properties.Operating System",
"$.data.event_data.person_properties.Page",
"$.data.event_data.person_properties.Page URL",
"$.data.event_data.person_properties.Referrer URL",
"$.data.event_data.person_properties.User Agent",
"$.data.event_data.person_properties.delighted_source",
"$.data.event_data.person_properties.user_id",
"$.data.event_data.score",
"$.data.event_data.survey_type",
"$.data.event_data.tags",
"$.data.event_data.updated_at",
"$.data.event_id",
"$.data.event_type"
]
}
163 changes: 163 additions & 0 deletions schemas/com.delighted/survey_response_created/jsonschema/1-0-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for a Delighted survey response created",
"self": {
"vendor": "com.delighted",
"name": "survey_response_created",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"event_type": {
"type": "string",
"enum": ["survey_response.created"],
"description": "This describes what kind of event triggered this webhook. It is composed of an object type and an action, separated by a period"
},
"event_id": {
"type": "string",
"maxLength": 64,
"description": "The event_id can be used to deduplicate notifications that may be delivered more than once"
},
"event_data": {
"type": "object",
"properties": {
"id": {
"type": "string",
"maxLength": 20,
"description": "Response id"
},
"person": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Responder id",
"maxLength": 25
},
"email": {
"type": ["string", "null"],
"maxLength": 255,
"description": "Responder email address"
},
"name": {
"type": ["string", "null"],
"maxLength": 255,
"description": "Responder name"
},
"created_at": {
"type": "integer",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using integers for all the timestamps is going to bleed complexity downstream into all consumers of these events. How difficult would it be to convert these in the adapter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've thought about the best way to do this a bit. A large number of webhooks just give epoch timestamps rather than nicely formatted ISO datetimes. It's possible to do these quite easily in the adapter but it does mean that all webhooks with epochs require adapters.

"minimum": 0,
"maximum": 2147483647,
"description": "Responder created at (in epoch seconds)"
},
"phone_number": {
"type": ["string", "null"],
"description": "Responser mobile phone number",
"maxLength": 25
}
}
},
"survey_type": {
"type": "string",
"enum": ["nps"]
},
"score": {
"type": ["integer", "null"],
"description": "NPS score",
"minimum": 0,
"maximum": 10
},
"comment": {
"type": ["string", "null"],
"maxLength": 512,
"description": "Survey comment"
},
"permalink": {
"type": "string",
"maxLength": 255,
"description": "Permalink to the response"
},
"created_at": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647,
"description": "Response created at (in epoch seconds)"
},
"updated_at": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647,
"description": "Response updated at (in epoch seconds)"
},
"person_properties": {
"type": ["object", "null"],
"description": "Custom user properties",
"properties": {
"delighted_source": {
"type": ["string", "null"],
"description": "Visitor source e.g., Web",
"maxLength": 50
},
"Page": {
"type": ["string", "null"],
"maxLength": 255
},
"Page URL": {
"type": ["string", "null"],
"maxLength": 512
},
"Referrer URL": {
"type": ["string", "null"],
"maxLength": 512
},
"User Agent": {
"type": ["string", "null"],
"maxLength": 256
},
"IP Address": {
"type": ["string", "null"],
"maxLength": 45
},
"Device Type": {
"type": ["string", "null"],
"maxLength": 100
},
"Operating System": {
"type": ["string", "null"],
"maxLength": 100
},
"Browser": {
"type": ["string", "null"],
"maxLength": 100
},
"Country": {
"type": ["string", "null"],
"maxLength": 100
},
"user_id": {
"type": ["string", "null"],
"maxLength": 100,
"description": "Snowplow user id"
}
}
},
"notes": {
"type": ["array", "null"],
"items": {
"type": "string"
},
"description": "Notes defined against a responder in the Delighted UI"
},
"tags": {
"type": ["array", "null"],
"items": {
"type": "string"
},
"description": "Tags defined against a responder in the Delighted UI"
}
}
}
},
"additionalProperties": false
}
Loading