My CRM send the following JSON to my webhook:
"last_conversion":
{
"content":
{
"identifier":"conv-list",
"created_at":"2020-05-09T22:06:29.049670Z",
"Name":"Test",
"BusinessName":"Test Business",
"Phone":"+201 (99) 9999-9999",
"gclid_field":"232938293"
},
"created_at":"2020-05-09T19:06:29.049-05:00"
}
Sending information to google ads requires a specific data format:
I would like to create a json with the following format:
{
"content_created_at":"2020-05-09T22:06:29-05:00",
"Name":"Test",
"created_at": "2020-05-09T19:06:29-05:00"
}
To achieve that, i should change both created_at keys
1) 2020-05-09T22:06:29.049670Z to 2020-05-09T22:06:29-05:00 (Removing the .049670Z and adding -05:00)
2) 2020-05-09T19:06:29.049-05:00 to 2020-05-09T19:06:29-05:00 (Removing the .049)
What is the most elegant way to achieve that? I'm trying some kind of regex but is not working as intended