페이로드 구조 및 예시

웹훅은 JSON 형태로 데이터를 전송합니다. 아래 페이로드에 대한 기본 구조 및 모아폼으로 만들 수 있는 모든 종류의 질문 형태들로 제작된 설문에 대한 샘플 답변을 웹훅으로 전송했을 때의 예시가 있습니다.

테스트 전송을 통해 본인이 만든 설문에 대한 샘플 페이로드만 받아서 참고하셔도 됩니다.

 

페이로드 구조

페이로드는 크게 이벤트 정보, form, answers, thankyou 로 구성되어 있습니다.

이벤트 정보는 해당 웹훅의 기본 정보, 발송 조건 등에 대한 정보입니다. form 은 해당 설문의 기본 정보를 담고 있고, answers 는 각 답변 데이터들의 세부 데이터를 담고 있습니다. thankyou 는 맺음말 페이지 정보를 가지고 있습니다.

 

이벤트 정보

웹훅의 기본 정보입니다.

ELEMENTTYPEDESCRIPTION
event_idstring웹훅의 고유 ID. 자동으로 부여됨
event_typestring웹훅 발송 조건, 현재는 'response_completed' 만 가능
object_typestringevent의 object_type, 현재는 'response'만 반환
response_idstring답변의 고유 ID
response_codestring답변 코드 (중복답변 제한 설정에서 '답변코드 및 URL로 제한' 옵션을 이용할 때의 그 코드이며, 코드값이 있을 때만 전송)
started_atstring답변 시작 일시
submitted_atstring답변 제출 일시

 

 

form

form 은 해당 설문지의 object 이며, 설문지의 정보를 보여줍니다. API를 이용하면 이보다 더 자세한 설문지 정보를 알 수 있습니다.

ELEMENTTYPEDESCRIPTION
formobject 
↳ long_idstring설문의 고유 ID
↳ idstringlong_id가 공식적인 설문 ID입니다. 과거 버전과의 호환성을 위해 id도 한시적으로 동작하지만, 앞으로 지원이 중단될 예정입니다. 가능한 long_id를 사용해 주세요.
↳ titlestring설문 제목
↳ answer_urlstring답변수집용 URL
↳ report_urlstring결과확인 페이지 URL
hiddenobject 
↳ d[n]string히든필드가 있을 경우에만 모든 히든 필드들을 같은 위계로 표시. n=1~100

 

answers

answers 는 해당 설문지 내 질문들에 대한 답변들을 보여주는 array of objects 입니다. 

ELEMENTTYPEDESCRIPTION
answers[object] 
↳ typestring답변의 타입
↳ blockobject 
     ↳ idstring항목의 고유 ID
     ↳ typestring항목의 종류
     ↳ contentstring항목의 내용
.........

 

위 표의 answers > type 에 각 답변의 타입이 나오고, 그 각 타입별로 세부 데이터가 달라지며 아래 별도 table 에서 설명드립니다. 각 타입별로 위 표의 ...  위치를 대체합니다. 

 

choice (여러 보기들 중 하나만 선택)

ELEMENTTYPEDESCRIPTION
↳ choiceobject 
     ↳ idstring보기의 고유 ID
     ↳ labelstring보기의 내용
     ↳ otherstring기타 보기에 입력한 답변 (기타 답변일 경우에만 나타남)
     ↳ scorenumber보기에 할당된 점수 (점수가 할당되어야만 나옴)

 

choices (여러 보기들 중 여러개 선택)

ELEMENTTYPEDESCRIPTION
↳ choices[object] 
     ↳ idstring보기의 고유 ID
     ↳ labelstring보기의 내용
     ↳ otherstring기타 보기에 입력한 답변 (기타 답변일 경우에만 나타남)
     ↳ scorenumber보기에 할당된 점수 (점수가 할당되어야만 나옴)

순위형 질문의 경우 나열되는 답변의 순서가 곧 순위입니다.

 

media_choice (여러 미디어 보기들 중 하나만 선택)

ELEMENTTYPEDESCRIPTION
↳ media_choiceobject 
     ↳ idstring보기의 고유 ID
     ↳ labelstring보기의 내용
     ↳ otherstring기타 보기에 입력한 답변 (기타 답변일 경우에만 나타남)
     ↳ scorenumber보기에 할당된 점수 (점수가 할당되어야만 나옴)
     ↳ mediaobject 
          ↳ urlstring이미지 URL
          ↳ typestring미디어 형태 (현재는 image only)

 

media_choices (여러 미디어 보기들 중 여러개 선택)

ELEMENTTYPEDESCRIPTION
↳ media_choices[object] 
     ↳ idstring보기의 고유 ID
     ↳ labelstring보기의 내용
     ↳ otherstring기타 보기에 입력한 답변 (기타 답변일 경우에만 나타남)
     ↳ scorenumber보기에 할당된 점수 (점수가 할당되어야만 나옴)
     ↳ mediaobject 
          ↳ urlstring이미지 URL
          ↳ typestring미디어 형태 (현재는 image only)

순위형 질문의 경우 나열되는 답변의 순서가 곧 순위입니다.

 

text (주관식)

ELEMENTTYPEDESCRIPTION
↳ textstring텍스트 입력값
↳ encryptedboolean답변 암호화 저장 여부 ("true" 일때만 나옴)

 

email (이메일)

ELEMENTTYPEDESCRIPTION
↳ emailstring이메일 주소
↳ encryptedboolean답변 암호화 저장 여부 ("true" 일때만 나옴)

 

url (url)

ELEMENTTYPEDESCRIPTION
↳ urlstring웹사이트 URL
↳ encryptedboolean답변 암호화 저장 여부 ("true" 일때만 나옴)

 

number (답변이 숫자인 경우, 척도형, 별점형, 수치입력형 등)

ELEMENTTYPEDESCRIPTION
↳ numbernumber답변 숫자값
↳ encryptedboolean답변 암호화 저장 여부 (수치입력형만, "true" 일때만 나옴)

 

address (주소)

ELEMENTTYPEDESCRIPTION
↳ address[object] 
     ↳ streetstringstreet 입력값 (visibile_fields로 정의되어야만 나옴)
     ↳ detailstringdetail 입력값 (visibile_fields로 정의되어야만 나옴)
     ↳ citystringcity 입력값 (visibile_fields로 정의되어야만 나옴)
     ↳ regionstringregion 입력값 (visibile_fields로 정의되어야만 나옴)
     ↳ postal_codestringpostal_code 입력값 (visibile_fields로 정의되어야만 나옴)
     ↳ countrystringcountry 입력값 (visibile_fields로 정의되어야만 나옴)
↳ encryptedboolean답변 암호화 저장 여부 ("true" 일때만 나옴)

 

files (첨부파일)

ELEMENTTYPEDESCRIPTION
↳ files[object] 
     ↳ namestring파일명
     ↳ sizeinteger파일 사이즈
     ↳ urlobject 
          ↳ apistring파일 다운로드 API URL (API 를 통해서만 다운로드 가능한 URL)
          ↳ reportstring파일 다운로드 웹사이트 URL (소유자이거나 공동작업자이면서 PRO 회원이면 바로 다운로드 가능한 URL)

 

row (격자형)

격자형 질문의 경우 choice 와 choices 의 array 이므로 아래 표에서 ... 위치에 위 choice 또는 choices 표가 또 들어가는 형태다. 이때 choice 또는 choices 는 rows object 의 하위로 들어간다.

ELEMENTTYPEDESCRIPTION
↳ rows[object] 
     ↳ typestring답변 타입
     ↳ blockobject 
          ↳ idstring소질문의 고유 ID
          ↳ contentstring소질문의 내용
.........

 

answers array는 답변 데이터가 있는 경우만 페이로드에 표시됩니다. 답변자가 비필수 질문에 답변하지 않았거나, 로직으로 질문을 건너뛰어서 답변하지 않아서 그 질문에 답변 데이터가 없으면 페이로드에 그 질문의 answers array가 표시되지 않습니다.

 

thankyou

모아폼으로 제작된 설문에 답변을 마치고 최종 제출하면 항상 맺음말 페이지로 이동하게 됩니다. 맺음말 페이지는 여러개 존재할 수 있고, 답변자를 로직을 통해 이들 중 하나의 맺음말 페이지로 이동하게 됩니다. 해당 답변자가 최종적으로 도달한 맺음말 페이지의 id와 url을 페이로드에 표시해 줍니다.

ELEMENTTYPEDESCRIPTION
thankyouobject 
↳ idstring맺음말의 고유 ID
↳ urlstring맺음말 페이지 url

 

 

페이로드 예시

모아폼의 모든 형태의 질문들이 포함된 페이로드 예시입니다. 

{
  "event_id": "4ebbbcdb-7f4b-47a9-a72c-1009b4990d12",
  "event_type": "response_completed",
  "hidden": {
    "d1": "andrew"
  },
  "response_id": "123-45-67890",
  "started_at": "2024-02-01T04:50:10Z",
  "submitted_at": "2024-02-01T04:55:13Z",
  "form": {
    "long_id": "ih0vvtuk3o1ns44wow9dkub3",
    "id": "ih0vvtuk3o1ns44wow9dkub3",
    "title": "Google Gemini User Experience Survey",
    "report_url": "https://www.moaform.com/reports/aZlOQ0RjJNR64YWb",
    "answer_url": "https://moaform.com/q/yGV1GF"
  },
  "answers": [
    {
      "block": {
        "id": "cls2lcsmq00082v6moddhz0hs",
        "type": "single_choice",
        "title": "<p>How often do you use Google Gemini?</p>"
      },
      "type": "choice",
      "choice": {
        "id": "cls2lcsmq000a2v6mfnn8y93n",
        "label": "<p>Daily</p>",
        "score": 1
      },
    },
    {
      "block": {
        "id": "cls2ldkvd00062v6nbpberh35",
        "type": "multiple_choice",
        "title": "<p>Which features of Google Gemini do you use? Select all that apply.</p>"
      },
      "type": "choices",
      "choices": [
        {
          "id": "cls2ldkvd00092v6nfe42p10y",
          "label": "<p>Cloud Storage</p>",
          "score": 1
        },
        {
          "id": "cls2lu0iy003p2v6n57wd3ave",
          "label": "<p>Maps</p>",
          "score": 2
        },
        {
          "id": "cls2ldkvd00072v6nvno7ue6h",
          "label": "<p>Search Engine</p>",
          "score": 3
        }
      ],
    },
    {
      "block": {
        "id": "cls2ldvil000c2v6nefizm132",
        "type": "dropdown",
        "title": "<p>Did you experience any issues while using Google Gemini?</p>"
      },
      "type": "choice",
      "choice": {
        "id": "cls2ldvil000e2v6n90i4kec7",
        "label": "<p>No</p>",
        "score": 2
      },
    },
    {
      "block": {
        "id": "cls2le19d000i2v6n0ppo6jxl",
        "type": "ranking",
        "title": "<p>Please rank the following Google Gemini services in order of importance to you.</p>"
      },
      "type": "choices",
      "choices": [
        {
          "id": "cls2le19d000l2v6n61biepmr",
          "label": "<p>Cloud storage space</p>"
        },
        {
          "id": "cls2le19d000j2v6nla70peux",
          "label": "<p>Search accuracy</p>"
        }
      ]
    },
    {
      "block": {
        "id": "cls2le8ax000o2v6n6eg0bx8a",
        "type": "media_single_choice",
        "title": "<p>Which type of media do you consume most frequently on Google Gemini platforms?</p>"
      },
      "type": "media_choice",
      "media_choice": {
        "id": "cls2m6nhn00402v6nxbmsqna6",
        "label": "<p>E-Books</p>",
        "score": 5
        "media": {
          "type": "image",
          "url": "https://robohash.org/commodioptioearum.png"
        }
      },
    },
    {
      "block": {
        "id": "cls2lgcvg000u2v6nfh7o8ivp",
        "type": "media_multiple_choice",
        "title": "<p>Select the types of media you have used or interacted with on Google Gemini services.</p>"
      },
      "type": "media_choices",
      "media_choices": [
        {
          "id": "cls2lgcvg000v2v6nszdcdswo",
          "label": "<p>Video tutorials</p>",
          "score": 1,
          "media": {
            "type": "image",
            "url": "https://robohash.org/doloresveldolor.png"
          }
        },
        {
          "id": "cls2m79fz00412v6nsff1q9wz",
          "label": "<p>News articles</p>",
          "score": 4,
          "media": {
            "type": "image",
            "url": "https://robohash.org/nihilrerummaiores.png"
          }
        }
      ],
    },
    {
      "block": {
        "id": "cls2lgoh100102v6noq3j19po",
        "type": "media_ranking",
        "title": "<p>Rank the following media types based on your preference for content consumption on Google Gemini.</p>"
      },
      "type": "media_choices",
      "media_choices": [
        {
          "id": "cls2lgoh100122v6nndvd1m8c",
          "label": "<p>Audio Content</p>",
          "media": {
            "type": "image",
            "url": "https://robohash.org/perferendisestomnis.png"
          }
        },
        {
          "id": "cls2m864s00442v6nibp8yiey",
          "label": "<p>Visual Content</p>",
          "media": {
            "type": "image",
            "url": "https://robohash.org/teneturrationealias.png"
          }
        },
        {
          "id": "cls2lgoh100112v6n1z0bpnym",
          "label": "<p>Video Content</p>",
          "media": {
            "type": "image",
            "url": "https://robohash.org/minusiureexplicabo.png"
          }
        },
        {
          "id": "cls2m80g000432v6n6a74huoc",
          "label": "<p>Interactive Content</p>",
          "media": {
            "type": "image",
            "url": "https://robohash.org/aspernaturreprehenderitaut.png"
          }
        },
        {
          "id": "cls2lgoh100132v6ngiepv9jk",
          "label": "<p>Written Content</p>",
          "media": {
            "type": "image",
            "url": "https://robohash.org/aspernaturautut.png"
          }
        },
        {
          "id": "cls2lgoh100152v6nyggfy2y7",
          "label": "other",
          "other": "You can get anything you want at Alice's restaurant.",
          "media": {
            "type": "image",
            "url": ""
          }
        },
      ]
    },
    {
      "block": {
        "id": "cls2lv2jp003r2v6nc14yp877",
        "type": "point_scale",
        "title": "<p>On a scale from -5 to 5, how would you rate the overall performance of Google Gemini?</p>"
      },
      "type": "number",
      "number": 3
    },
    {
      "block": {
        "id": "cls2lhfaa001c2v6n703dea3q",
        "type": "nps",
        "title": "<p>How likely are you to recommend Google Gemini to a friend or colleague? &nbsp;</p>"
      },
      "type": "number",
      "number": 5
    },
    {
      "block": {
        "id": "cls2lgyu700162v6nog617gmn",
        "type": "rating",
        "title": "<p>How would you rate the user interface of Google Gemini?</p>"
      },
      "type": "number",
      "number": 7
    },
    {
      "block": {
        "id": "cls2lho58001i2v6n4t10n5oj",
        "type": "matrix_single_choice",
        "title": "<p>What is your primary purpose for using Google Gemini?</p>"
      },
      "rows": [
        {
          "block": {
            "id": "cls2lho58001m2v6ns4hdd9nn",
            "title": "<p>at Home</p>"
          },
          "type": "choice",
          "choice": {
            "id": "cls2lho58001m2v6ns4hdd9nn:cls2lho58001l2v6nueh42tzp",
            "label": "<p>Educational activities</p>",
            "score": 3
          },
        },
        {
          "block": {
            "id": "cls2li5zy001o2v6n1dcjwute",
            "title": "<p>at Office</p>"
          },
          "type": "choice",
          "choice": {
            "id": "cls2li5zy001o2v6n1dcjwute:cls2lho58001j2v6np1atlo93",
            "label": "<p>Personal use</p>",
            "score": 1
          },
          }
      ]
    },
    {
      "block": {
        "id": "cls2lictr001p2v6nbqdrpp6s",
        "type": "matrix_multiple_choice",
        "title": "<p>Which Google Gemini features do you use regularly? Select all that apply.</p>"
      },
      "rows": [
        {
          "block": {
            "id": "cls2lictr001t2v6nxzl24rsy",
            "title": "<p>at Home</p>"
          },
          "type": "choices",
          "choices": [
            {
              "id": "cls2lictr001t2v6nxzl24rsy:cls2mchoe00462v6n5trjchsw",
              "label": "<p>Maps</p>".
              "score": 4
            }
          ],
        },
        {
          "block": {
            "id": "cls2lictr001u2v6n9xntfosy",
            "title": "<p>at Office</p>"
          },
          "type": "choices",
          "choices": [
            {
              "id": "cls2lictr001u2v6n9xntfosy:cls2lictr001s2v6na1kvxgh8",
              "label": "<p>Drive</p>",
              "score": 1
            },
            {
              "id": "cls2lictr001u2v6n9xntfosy:cls2lictr001q2v6nh82ekevh",
              "label": "<p>Search</p>",
              "score": 3
            }
          ],
        }
      ]
    },
    {
      "block": {
        "id": "cls2lipfv001w2v6nothvfcj1",
        "type": "matrix_ranking",
        "title": "<p>Rank the devices you most frequently use to access Google Gemini services.</p>"
      },
      "rows": [
        {
          "block": {
            "id": "cls2lipfv00202v6nsd0qhctz",
            "title": "<p>at Home</p>"
          },
          "type": "choices",
          "choices": [
            {
              "id": "cls2lipfv00202v6nsd0qhctz:cls2lipfv001x2v6n08hhaqo8",
              "label": "<p>Smartphone</p>"
            },
            {
              "id": "cls2lipfv00202v6nsd0qhctz:cls2lipfv001y2v6niexsh5ro",
              "label": "<p>Tablet</p>"
            },
            {
              "id": "cls2lipfv00202v6nsd0qhctz:cls2me0bu00492v6nqtwno5mg",
              "label": "<p>Smartwatch</p>"
            },
            {
              "id": "cls2lipfv00202v6nsd0qhctz:cls2lipfv001z2v6nygztclsc",
              "label": "<p>Laptop</p>"
            },
            {
              "id": "cls2lipfv00202v6nsd0qhctz:cls2mdwe300482v6nzia1b5bc",
              "label": "<p>Desktop</p>"
            }
          ]
        },
        {
          "block": {
            "id": "cls2lipfv00212v6n0jsyogyx",
            "title": "<p>at Office</p>"
          },
          "type": "choices",
          "choices": [
            {
              "id": "cls2lipfv00212v6n0jsyogyx:cls2lipfv001x2v6n08hhaqo8",
              "label": "<p>Smartphone</p>"
            }
          ]
        },
        {
          "block": {
            "id": "cls2meu2a004a2v6nqt0ambov",
            "title": "<p>at School</p>"
          },
          "type": "choices",
          "choices": [
            {
              "id": "cls2meu2a004a2v6nqt0ambov:cls2lipfv001y2v6niexsh5ro",
              "label": "<p>Tablet</p>"
            },
            {
              "id": "cls2meu2a004a2v6nqt0ambov:cls2mdwe300482v6nzia1b5bc",
              "label": "<p>Desktop</p>"
            }
          ]
        }
      ]
    },
    {
      "block": {
        "id": "cls2lixno00232v6nrofkx97v",
        "type": "long_text",
        "title": "<p>What improvements would you like to see in future updates of Google Gemini? &nbsp;</p>",
        "encrypted": true
      },
      "type": "text",
      "text": "Culpa architecto nesciunt. Distinctio asperiores dolore. Fuga a consequatur.\nBeatae eum blanditiis. Quia ut aspernatur. Est et est.\nMinus incidunt expedita. Autem vel quia. Nisi nobis quam."
    },
    {
      "block": {
        "id": "cls2ljluw002a2v6nhec80sfu",
        "type": "short_text",
        "title": "<p>What is your favorite aspect of Google Gemini?</p>",
        "encrypted": true
      },
      "type": "text",
      "text": "Nemo aperiam voluptatem.\nSunt cum aut.\nVel accusantium deleniti."
    },
    {
      "block": {
        "id": "cls2lkb4z002h2v6neg2u3axs",
        "type": "address",
        "title": "<p>Please provide your full address for our records.</p>",
        "encrypted": true
      },
      "type": "address",
      "address": [
        {
          "street": "1264 Bashirian River"
        },
        {
          "detail": "Apt. 204"
        },
        {
          "city": "Antoinefort"
        },
        {
          "region": "Tennessee"
        },
        {
          "postal_code": "11952"
        },
        {
          "country": "American Samoa"
        }
      ]
    },
    {
      "block": {
        "id": "cls2lks7x002o2v6n4o653zs9",
        "type": "numeric_value",
        "title": "<p>How many years have you been using Google Gemini?</p>",
        "encrypted": true
      },
      "type": "number",
      "number": 10
    },
    {
      "block": {
        "id": "cls2ll3pd002v2v6n3zja3wmp",
        "type": "email",
        "title": "<p>Enter your email address to receive updates or to be contacted for further feedback.</p>",
        "encrypted": true
      },
      "type": "email",
      "email": "cinthia@hodkiewicz.example"
    },
    {
      "block": {
        "id": "cls2llc4b00322v6nsi7sgi9o",
        "type": "url",
        "title": "<p>If you have a personal website or a portfolio, please enter the URL here.</p>",
        "encrypted": true
      },
      "type": "url",
      "url": "http://metz.example/jacinto_christiansen"
    },
    {
      "block": {
        "id": "cls2llkus00392v6n0b5heal9",
        "type": "file_upload",
        "title": "<p>If you have any screenshots of issues or errors, please upload them here.</p>"
      },
      "type": "files",
      "files": [
        {
          "name": "porro.doc",
          "size": 40389,
          "url": {
             "report": "https://www.moaform.com/reports/aZlOQ0RjJNR64YWb/responses/4EICalTehPKULp1_hzvo2Q/download/submission_files/bab2d598-1405-4da7-82d2-ceabd193e4c5",
             "api": "https://api.moaform.com/v1/forms/jW5o2M/responses/123-45-67890/files/bab2d598-1405-4da7-82d2-ceabd193e4c5"
          }
      ]
    }
  ],
  "thankyou": {
    "id": "cls2lbwjk00010enyd9gjjvur",
    "url": "https://answer.moaform.com/answers/jW5o2M/thankyou/Wo2b1Z09wx5"
  }
}