A
A
Alex94162021-08-18 20:30:19
Google Apps Script
Alex9416, 2021-08-18 20:30:19

How to implement Marquiz integration in Google Sheets?

Merquiz sends a WebHook to the specified link like:

{
"raw": [
{
"q": "ab6c5412-5c7f-489d-8d79-173ce632930e",
"a": "3f0bb0ea-fc31-4b49-86b5-337ca0cf86da"
},
{
"q": "d337ecb3-b903-4664-94c1-16acf2c2e3bb",
"a": "f3d4933b-6af3-48a9-a836-0173bbbf6415"
}
],
"answers": [
{
"q": "Какая сумма Вашей задолженности перед кредитными организациями в рублях?*",
"a": "Более 1 000 000 руб."
},
{
"q": "Срок просрочки по кредитам?",
"a": "от 1 до 3 месяцев"
}
],
"contacts": {
"name": "Имя",
"email": "[email protected]",
"phone": "89851234567"
},
"quiz": {
"id": "600920a2de60d9004900edb9",
"name": "Генератор подарков"
},
"created": "2018-12-19T10:23:25.796Z",
"extra": {
"href": "http://example.com",
"utm": {
"source": "test_source",
"medium": "test_medium",
"name": "test_campaign", // Campaign
"content": "test_content",
"term": "test_term"
},
"cookies": {
"roistat_visit": "95852",
"roistat_marker": "example.com",
"roistat_marker_old": "example.com",
"roistat_call_tracking": "1",
"roistat_emailtracking_email": "null",
"_ga": "GA1.3.2016698540.1531763909"
},
"discount": 3,
"discountType": "melting",
"discountCurrency": "₽",
"currency": "RUB",
"currencySymbol": "₽",
"notify": "now",
"ab": "A", (если включено A/B тестирование)
"timezone": 5,
"lang": "ru",
"referrer": "http://example.com"
"ip": "111.11.111.111"
}
"result": {
"id": "OBq5B3FYI6",
"title": "Заголовок результата",
"cost": "1500",
"minCost": null,
"maxCost": null
}
}


What script can implement the output of this data in Google Sheets?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2021-08-19
@ProgrammerForever

  1. Make a script in which, using JSON.parse (if necessary), you get the data you need.
  2. Call the function doGet or doPost (most likely the data is sent via a POST request).
  3. Publish the script, get a link to the webhook.
  4. Feed the webhook to your system.

Notes:
  • Logger does not work in doPost;
  • Any time you edit the code, you need to redeploy the script and get a new webhook;

If you need a ready-made solution - write in a personal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question