@David_Go if I can get your help that would be great.
My exact use case will differ, but I figure what I will learn from this will help me learn.
I getting data via HTTP request and API.
The data received is entry data for all paddlers that have entered a race.
K1 is means they are paddling a single canoe. So if there is data for K1 but K2,3,4 or all null then that person is in a single.
Obv is there is data for K1 and K2 that is a double canoe and those are a 2 people canoe
Sample data set below.
[
{
"ok": true,
"entries": [
{
"k1": {
"name": "JON DOE",
"csaId": 6769
},
"k2": {
"name": "Dave Doe",
"csaId": 61277
},
"k3": null,
"k4": null,
"entryDate": "2019-08-09",
"entryTime": "21:29:03",
"raceName": "GARA DOLPHIN COAST 17&18 AUG 2019",
"orderNumber": "ORD00001197"
},
{
"k1": {
"name": "Jane Doe",
"csaId": 8977
},
"k2": null,
"k3": null,
"k4": null,
"entryDate": "2019-08-09",
"entryTime": "18:12:36",
"raceName": "GARA DOLPHIN COAST 17&18 AUG 2019",
"orderNumber": "ORD00001194"
},
{
"k1": {
"name": "Sharon Doe",
"csaId": 555
},
"k2": null,
"k3": null,
"k4": null,
"entryDate": "2019-08-09",
"entryTime": "17:28:27",
"raceName": "GARA DOLPHIN COAST 17&18 AUG 2019",
"orderNumber": "ORD00001190"
},
}
]
}
]
The csaId is a unique identifier.
I need to extract all the entries for a race, determine if they are paddling a k1, k2 or a k3 (3 person canoe).
If they are paddling in a k2 or k3, Create a team name for them that will have the format of “T Jon Doe and Dave Doe” If a K3 then the third name would be added.
I then to send the data to mautic for which n8n has a node.
In mautic
The mautic node requires an email as the unique ID so I would need to get the API updated so I can get that info from the entry data base.
I need to look to see if the casId (email aswell?) already exists, if it does I need to update the both record with the team name if appropriate. There is a field called “Team name 2022” waiting to receive that. Both members of the team would need their individual records updated with the same team name.
If the record does not exist I would need to create it and populate it. There is a second API call I can do that searches the 3rd party data base by csaId and returns all the info needed to populate the new record in Mautic. How do I bring in the second API call? Below is the data I get back.
{
"ok": true,
"memberFound": true,
"memberDetails": {
"csaId": 394,
"firstName": "TIM",
"lastName": "TESTER",
"dateOfBirth": "1994-04-16",
"clubName": "Freedom Paddlers Club",
"unionName": "Western Cape",
"licenceTypeName": "Senior",
"expiryDate": "2022-08-29",
"activationDate": "2021-08-30",
"gender": "MALE",
"singlesProficiency": "AR+",
"doublesProficiency": "AR+",
"skiProficiency": "Open Ocean"
}
}
]
I need to tag the record “2022 Surfski Double” or “2022 Surfski Single” or “2022 Surfski Triple” based on if they are k1 k2 or k3.
In production I would have a cron check via API for new entries and I would only want to bring across new entries since the last check.
Complicated and you may need to be a detective to follwo all that.