davidbenge/dep_webhook

Additional Info in Line Item Row Header

Opened this issue · 4 comments

Can we put in the line item row header more info as laid out below?
Current:

  • Timestamp

Future:

  • [timestamp] - [sandbox] - [Segment status] - [Segment name] - [identityMap first index in namespace] - [custom1]

  • e.g.

  • 8/1/2022, 5:00:00 PM - lab-001 - existing Any Event - data-prep-test-lab-1@email.com - null

  • 8/1/2022, 6:00:00 PM - lab-001 - exiting Bought iPhone 13 - 500785912 - Danny

    Header
    x-sandbox-name
    Body
    segmentMembership.ups.[GUID].Name
    segmentMembership.ups.[GUID].Status
    identityMap.[namespace].[0].id
    Custom Path1

I'm exploring options to either pass the GUID, namespace or custom1 in the Header or Query Params. Do you have a preference?

I will have the learner specify in the header or query param:

  • GUID: [copy paste being sent]
  • namespace: [copy paste being sent]
  • Custom Path1: [copy paste being sent]. Note: this would be any path specified (e.g. using payload below, Person.name.firstname or _dxp.customerId)

Example Payload:
{
"id": 1659398491,
"call-time": 1659398491,
"call-body-size": 542,
"body": {
"messages": [
{
"segmentMembership": {
"ups": {
"442562dd-04f7-48c9-85f4-01155c32e42b": {
"lastQualificationTime": "2022-07-30T16:23:19Z",
"status": "existing",
"name": "Any Event"
}
}
},
"identityMap": {
"customerid": [
{
"id": "962105342"
}
],
"email": [
{
"id": "data-prep-test-lab-1@email.com"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e9bbb"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e9ccb"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e91ccb"
},
{
"id": "saurabh@adbe.com"
},
{
"id": "mchicchetto0@msn.com"
}
]
},
"_dxp": {
"customerID": "null"
},
"person": {
"name": {
"firstName": "null"
}
}
}
]
},
"headers": {
"accept-encoding": "gzip, deflate",
"connection": "close",
"content-type": "application/json",
"host": "controller",
"uber-trace-id": "6ca259a562390fd0:6cc8fab435859457:11e42a52329788e9:0",
"user-agent": "Amazon CloudFront",
"x-body-template": "PEBBLE_V1",
"x-created-timestamp": "1659398485306",
"x-domain": "activation",
"x-path": "/api/v1/web/dx-excshell-1/webhook/lab-001",
"x-request-id": "3f4182f7-afc1-9416-a79f-7287d8325bc2",
"x-retried-smarts": "0",
"x-route": "985c23c8-c5ad-4834-a411-d65882e13810",
"x-sandbox-id": "93bdb550-ad0e-49f6-bdb5-50ad0ec9f664",
"x-sandbox-name": "lab-001",
"x-source-connection-id": "917435c6-d366-4b22-9892-14941a8dee59",
"x-target": "985c23c8-c5ad-4834-a411-d65882e13810",
"x-target-connection-id": "0cac3a02-ed02-455c-a302-4ddbc9f4f193",
"x-tenant": "37E0399C61687C4E0A495E06"
},
"query-params": {}
}

Either query or header will work. query might be better

https://27200-depwebhook-stage.adobeio-static.net/api/v1/web/dx-excshell-1/webhook/dave1?GUID=test_guid&namespace=test_namespace&custom_path=body.to.test_deep

{
    "test_param":"5f60323b-82e6-test-a6d8-dave",
    "test_number":1234,
    "to":{"test_deep":"test deep value"}
}

Tested
Did
timestamp - GUID - namespace - custom_path

Very cool, but I didn't explain it well.
They payload will contain a path in the query string to a key that I want you to get a value for in the Body and show in the row.
e.g. payload
"segmentMembership": {
"ups": {
"442562dd-04f7-48c9-85f4-01155c32e42b": {
"lastQualificationTime": "2022-07-30T16:23:19Z",
"status": "existing",
"name": "Any Event"

What I want shown is the status (i.e. "existing") and name (i.e. "Any Event") in the row.
The problem is the path to status is dynamic. (i.e. "442562dd-04f7-48c9-85f4-01155c32e42b" will be different for each segment.

The same for identityMap:
e.g. payload
"identityMap": {
"customerid": [
{
"id": "962105342"
}
],
"email": [
{
"id": "data-prep-test-lab-1@email.com"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e9bbb"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e9ccb"
},
{
"id": "f82af383-cc27-427b-a97e-4ed4340d3e91ccb"
},
{
"id": "saurabh@adbe.com"
},
{
"id": "mchicchetto0@msn.com"
}
]
}
What I want shown is the id for the identityMap (i.e. "data-prep-test-lab-1@email.com") in the row.
The problem is the namespace "email" path to id is dynamic. (i.e. "identityMap[email][0]") will be different for each namespace. e.g. "identityMap[customerid][0]"

The Custom Path1 is something that allows the learner to put in any custom path.
Payload:
"_dxp": {
"customerID": "null"
},
"person": {
"name": {
"firstName": "null"
}
}

I would like firstName to show up in the row.
The problem is each Segment may want to have different fields show up. i.e. some may want firstName, some may want lastName.

what about this
in query pass some special params line
_dp_GUID=body.guid&_dp_status&custom_path=body._dp_GUID._dp_status

Bad example but use dp for dynamic param and item after the _ as the VAR NAME then = where I get the value
seems like it could be brittle but what do you think?