{
    "componentChunkName": "component---src-templates-protocol-protocol-tsx",
    "path": "/survey/1.0/",
    "result": {"data":{"markdownRemark":{"html":"<h2 id=\"Summary\">Summary</h2>\n<p>The Survey protocol enables a <a href=\"https://jsonforms.io/\">JSONForms</a> based request-response interaction to be carried out across a DIDComm channel. An agent sends a survey request to be completed by another agent and gets back the answers message in a subsequent DIDComm message.</p>\n<h2 id=\"Motivation\">Motivation</h2>\n<p>Surveys are an important method for organizations to gather data from a sample of people to understand the population better and make informed business decisions. These surveys should be reliable, usable and customizable to be used in a wide variety of contexts. JSON Forms utilizes the capabilities of JSON and JSON schema and provides a simple and declarative way of describing forms. This reusable framework allows organizations to declare forms, including data-binding, input validation, and rule-based visibility.</p>\n<h2 id=\"Tutorial\">Tutorial</h2>\n<h3 id=\"Name-and-Version\">Name and Version</h3>\n<p>This is the survey protocol. It is uniquely identified by the URI:</p>\n<pre><code>\"https://didcomm.org/survey/1.0\"\n</code></pre>\n<h3 id=\"Key-Concepts\">Key Concepts</h3>\n<p>The protocol consists of a DIDComm request message carrying a JSON survey request to a responding agent, and a second message that carries the answers of the responder to the survey back to the client of the first message.</p>\n<h3 id=\"Basic-Walkthrough\">Basic Walkthrough</h3>\n<p>The survey protocol requires an active DIDComm connection before it can proceed. One agent behaves as a requester in the protocol and the other agent represents a responder. Conceptually the requester sends a message to the responder containing the survey (questions-schema, ui-schema, initial data, and internationalization data) which is rendered as a survey in the wallet of the responder. The responder can either decline the survey or complete the survey.</p>\n<p>The protocol can only be initiated by the requester by selecting the survey and connection. The protocol ends when the responder replies with an answer or declines. At any time a requester can send another survey to the connection.</p>\n<h3 id=\"Roles\">Roles</h3>\n<p>There are two parties in a typical survey interaction. The first party, <code>requester</code>, issues the survey with its schemata and the second party, <code>responder</code>, responds with the answer-data. The parties must have already exchanged pairwise keys and created a connection. These keys can be used to encrypt and verify the response. When the response is received by the requestion, the requestor can know with a high level of certainty that it was sent by responder.</p>\n<p>In this tutorial Alice (the <code>requester</code>) initiates the interaction, Alice creates the survey and sends it to Bob. The survey includes the questions, ui, initial data and i18n data.</p>\n<p>In this tutorial, Bob (the <code>responder</code>) receives the request and must respond to the survey (or decline it).</p>\n<h3 id=\"States\">States</h3>\n<p>This protocol follows the request-response protocol style and only requires the simple state of producing a conversational message and waiting for a response.</p>\n<p>The <code>abandoned</code> and <code>completed</code> states are terminal states and there is no expectation that the protocol can be continued after reaching those states.</p>\n<p>Either party may send a problem-report message earlier in the flow to terminate the protocol before its normal conclusion.</p>\n<h4 id=\"States-for-Requester\">States for Requester</h4>\n<p>The <code>requester</code> agent goes through the following states:</p>\n<ul>\n<li>request-sent</li>\n<li>completed</li>\n</ul>\n<p>The state transition table for the <code>requester</code> is:</p>\n<table>\n<thead>\n<tr>\n<th>State/Event</th>\n<th>Send Request</th>\n<th>Receive Response</th>\n<th>Send or Receive Problem Report</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><em>start</em></td>\n<td>Transition to <strong>request-sent</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>request-sent</td>\n<td></td>\n<td>Transition to <strong>completed</strong></td>\n<td>Transition to <strong>abandoned</strong></td>\n</tr>\n<tr>\n<td>completed</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>abandoned</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"States-for-Responder\">States for Responder</h4>\n<p>The <code>responder</code> agent goes through the following states:</p>\n<ul>\n<li>request-received</li>\n<li>completed</li>\n</ul>\n<p>The state transition table for the <code>responder</code> is:</p>\n<table>\n<thead>\n<tr>\n<th>State/Event</th>\n<th>Receive Request</th>\n<th>Send Response</th>\n<th>Send or Receive Problem Report</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><em>start</em></td>\n<td>Transition to <strong>request-received</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>request-received</td>\n<td></td>\n<td>Transition to <strong>completed</strong></td>\n<td>Transition to <strong>abandoned</strong></td>\n</tr>\n<tr>\n<td>completed</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>abandoned</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p>After receiving a survey-request, the responder may send a problem-report to the requestor using the information in the request to decline (abandon) the protocol.</p>\n<h3 id=\"Messages\">Messages</h3>\n<h3 id=\"Survey-Request-Message\">Survey Request Message</h3>\n<p>The protocol begins when the <code>requester</code> sends a <code>survey-request</code> message to the responder:</p>\n<p>DIDComm V1 Example:</p>\n<pre><code class=\"language-json\">{\n    \"@type\": \"https://didcomm.org/survey/1.0/request\",\n    \"@id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"~thread\": {\n        \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\"\n    },\n    \"request\": {\n        \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n        \"survey_schema\": {\n            \"json_object\": \"json object defining the survey schema with the questions, answers and validations\"\n        },\n        \"ui_schema\": {\n            \"json_object\": \"json object defining the ui schema such as layout, controls, help text to aid rendering of the survey\"\n        },\n        \"init_data\": {\n            \"json_object\": \"json object containing the data to prefill answers\"\n        },\n        \"i18n_data\": {\n            \"json object\": \"json object containing the translations\"\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<p>The items in the message are as follows:</p>\n<ul>\n<li><code>@type</code> -- required, must be as above</li>\n<li><code>@id</code> -- required, must be as defined in [RFC 0005 DIDComm]</li>\n<li><code>~thread</code> -- required, must be as defined in [RFC 0008 Message ID and Threading]</li>\n<li><code>request</code> -- required, an item containing a JSONForms JSON structures. must be a single JSONForms request\n<ul>\n<li><code>survey_id</code> -- required, contains the survey identifier to uniquely identify the survey in the business logic</li>\n<li><code>survey_schema</code> -- required, contains the questions, answers and validations</li>\n<li><code>ui_schema</code> -- required, contains layout, controls, help labels</li>\n<li><code>init_data</code> -- optional, it can be used to prefill/preselect answers for questions in the survey</li>\n<li><code>i18n_data</code> -- optional, contains translations for the questions, answer options and labels</li>\n</ul>\n</li>\n<li><code>expires_time</code> is optional</li>\n</ul>\n<p>DIDComm V2 Example:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"request\": {\n            \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n            \"survey_schema\": {\n                \"json_object\": \"json object defining the survey schema with the questions, answers and validations\"\n            },\n            \"ui_schema\": {\n                \"json_object\": \"json object defining the ui schema such as layout, controls, help text to aid rendering of the survey\"\n            },\n            \"init_data\": {\n                \"json_object\": \"json object containing the data to prefill answers\"\n            },\n            \"i18n_data\": {\n                \"json object\": \"json object containing the translations\"\n            }\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<h4 id=\"Example-Request-Message-with-a-survey\">Example Request Message with a survey</h4>\n<p>The survey is declared as JSON objects in the Survey Request Message. In this example, we use a survey_schema which is an <code>object</code> with three properties <code>name</code>, <code>birthDate</code> and <code>nationality</code>.</p>\n<p>Survey Schema:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n      \"name\": {\n        \"type\": \"string\",\n        \"minLength\": 3,\n        \"description\": \"Please enter your name\"\n      },\n      \"birthDate\": {\n        \"type\": \"string\",\n        \"format\": \"date\"\n      },\n      \"nationality\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"DE\",\n          \"IT\",\n          \"JP\",\n          \"US\",\n          \"NL\",\n          \"Other\"\n        ]\n      }\n    },\n    \"required\": [\n      \"name\",\n      \"nationality\"\n    ]\n  }\n</code></pre>\n<p>The UI schema describes the general layout of the survey. It is a JSON object that defines the controls, layouts (horizontal, vertical, groups) and rules.</p>\n<p>UI Schema:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"HorizontalLayout\",\n    \"elements\": [\n        {\n            \"type\": \"Control\",\n            \"label\": \"Name\",\n            \"scope\": \"#/properties/name\"\n        },\n        {\n            \"type\": \"Control\",\n            \"label\": \"Birth Date\",\n            \"scope\": \"#/properties/birthDate\"\n        },\n        {\n            \"type\": \"Control\",\n            \"scope\": \"#/properties/nationality\"\n        }\n    ]\n}\n</code></pre>\n<p>The <code>init_data</code> represents an object containing the data to be rendered in the survey. This can be used to prepopulate the form with data.</p>\n<p>Initial Data:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"John Doe\",\n  \"birthDate\": \"1985-06-02\"\n}\n</code></pre>\n<p>Provides internationalization data for handling the translations (and to render locale specific UI elements, e.g. formatting of numbers). This example translates the Survey <code>title</code>, <code>description</code> and <code>name</code> property.</p>\n<p>I18n Data:</p>\n<pre><code class=\"language-json\">{\n    \"English\": {\n        \"title\": \"Hello\",\n        \"description\": \"Test\",\n        \"name\": {\n            \"label\": \"What is your name?\"\n        }\n    },\n    \"Spanish\": {\n        \"title\": \"Hola\",\n        \"description\": \"Test\",\n        \"name\": {\n            \"label\": \"Que es nombre?\"\n        }\n    }\n}\n</code></pre>\n<p>Full example Survey request message:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"request\": {\n            \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n            \"survey_schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\n                        \"type\": \"string\",\n                        \"minLength\": 3,\n                        \"description\": \"Please enter your name\"\n                    },\n                    \"birthDate\": {\n                        \"type\": \"string\",\n                        \"format\": \"date\"\n                    },\n                    \"nationality\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"DE\",\n                            \"IT\",\n                            \"JP\",\n                            \"US\",\n                            \"NL\",\n                            \"Other\"\n                        ]\n                    }\n                },\n                \"required\": [\n                    \"name\",\n                    \"nationality\"\n                ]\n            },\n            \"ui_schema\": {\n                \"type\": \"HorizontalLayout\",\n                \"elements\": [\n                    {\n                        \"type\": \"Control\",\n                        \"label\": \"Name\",\n                        \"scope\": \"#/properties/name\"\n                    },\n                    {\n                        \"type\": \"Control\",\n                        \"label\": \"Birth Date\",\n                        \"scope\": \"#/properties/birthDate\"\n                    },\n                    {\n                        \"type\": \"Control\",\n                        \"scope\": \"#/properties/nationality\"\n                    }\n                ]\n            }\n        },\n        \"init_data\": {\n            \"name\": \"John Doe\",\n            \"birthDate\": \"1985-06-02\"\n        },\n        \"i18n_data\": {\n            \"English\": {\n                \"title\": \"Hello\",\n                \"description\": \"Test\",\n                \"name\": {\n                    \"label\": \"What is your name?\"\n                }\n            },\n            \"Spanish\": {\n                \"title\": \"Hola\",\n                \"description\": \"Test\",\n                \"name\": {\n                    \"label\": \"Que es nombre?\"\n                }\n            }\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<h3 id=\"Survey-Response-Message\">Survey Response Message</h3>\n<p>A <code>response</code> message is sent by the <code>responder</code> following the completion of the survey to convey the answers to the requester.</p>\n<p>If the <code>request</code> is unrecognizable as a JSONForms survey such that a survey cannot be rendered, the server SHOULD send a [RFC 0035 Report Problem] message to the client.</p>\n<p>DIDComm V1 Example:</p>\n<pre><code class=\"language-json\">{\n    \"@type\": \"https://didcomm.org/survey/1.0/request\",\n    \"@id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"~thread\": {\n        \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\"\n    },\n    \"response\": {\n        \"response_type\": \"data\",\n        \"data\": {\n            \"json_object\": \"json object containing the answers given by the responder\"\n        },\n    },\n}\n</code></pre>\n<p>DIDComm V2 Example:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"response\": {\n            \"response_type\": \"data\",\n            \"data\": {\n                \"json_object\": \"json object containing the answers given by the responder\"\n            }\n        }\n    }\n}\n</code></pre>\n<p>The items in the message are as follows:</p>\n<ul>\n<li><code>@type</code> -- required, must be as above</li>\n<li><code>@id</code> -- required, must be as defined in [RFC 0005 DIDComm]</li>\n<li><code>~thread</code> -- required, must be as defined in [RFC 0008 Message ID and Threading], same as the request</li>\n<li><code>request</code> -- required, an item containing a JSONForm as JSON objects. must be a single JSONForms request\n<ul>\n<li><code>response_type</code> -- required, the type of response, must be <code>data</code> if the survey was completed and returns the answer data. If the responder declines the survey the <code>response_type</code> must be <code>decline</code></li>\n<li><code>data</code> -- required, if <code>response_type</code> is <code>data</code> and will contain the answers provided by the responder, optional with other <code>response_type</code>'s. And will follow the same object structure as the <code>init_data</code> in the Request</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"Problem-Report-Message\">Problem Report Message</h3>\n<p>A [RFC 0035 Report Problem] message SHOULD be sent by the responder instead of a response message only if the request is unrecognizable as a JSONForms message.</p>\n<h2 id=\"L10n\">L10n</h2>\n<p>Translations for the survey are provided in the i18n_data attribute of the survey request message.</p>\n<h2 id=\"Prior-art\">Prior art</h2>\n<p>This protocol has similar goals to the <a href=\"https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md\">RFC 0113 Question &#x26; Answer</a> DIDComm protocol, but changes the approach to more complex use cases where the business case requires a broader set of questions and answers for a larger set of respondents. This Survey protocol can be used for multiple questions and answers in a single form (i.e. surveys) and in a more asynchronous environment (a -nearly- synchronous response is not expected). Surveys would typically be used to gather data from a group of people, unlike Question and Answer which appears to be more directed at a single respondent in a specific context.</p>\n<h2 id=\"Implementations\">Implementations</h2>\n<p>The following lists the implementations (if any) of this RFC. Please do a pull request to add your implementation. If the implementation is open source, include a link to the repo or to the implementation within the repo. Please be consistent in the \"Name\" field so that a mechanical processing of the RFCs can generate a list of all RFCs supported by an Aries implementation.</p>\n<table>\n<thead>\n<tr>\n<th>Name / Link</th>\n<th>Implementation Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"https://github.com/Entidad/credo-ts-survey\">credo-ts-survey</a></td>\n<td>Credo extension library</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/openwallet-foundation-labs/farmworker-wallet-os\">farmworker-wallet-os</a></td>\n<td>Farmworker Wallet OS, Credo SDK for Mendix low-code platform</td>\n</tr>\n</tbody>\n</table>","frontmatter":{"title":"Survey","tags":["survey","questionnaire","JSON-forms"],"license":"MIT","publisher":"stephanbruijnis","status":"Demonstrated","piuri":"https://didcomm.org/survey/1.0","summary":"A protocol where a survey (JSON Forms) is sent by the requester to the responder. The responder then replies with the answers or declines the survey.","authors":[{"name":"Stephan Bruijnis","email":"stephan.bruijnis@entidad.io"},{"name":"Jorge Flores","email":"jorge@entidad.io"}]},"fields":{"modifiedDate":"Mon Mar 16 2026 19:40:37 GMT+0000 (Coordinated Universal Time)","avatar":"https://avatars.githubusercontent.com/u/7125228?v=4&s=48","version":"1.0"}}},"pageContext":{"matchPath":"survey/1.0/*","id":"2b725e6e-9f14-5a1d-84c3-0cb42b1de7e0","html":"<h2 id=\"Summary\">Summary</h2>\n<p>The Survey protocol enables a <a href=\"https://jsonforms.io/\">JSONForms</a> based request-response interaction to be carried out across a DIDComm channel. An agent sends a survey request to be completed by another agent and gets back the answers message in a subsequent DIDComm message.</p>\n<h2 id=\"Motivation\">Motivation</h2>\n<p>Surveys are an important method for organizations to gather data from a sample of people to understand the population better and make informed business decisions. These surveys should be reliable, usable and customizable to be used in a wide variety of contexts. JSON Forms utilizes the capabilities of JSON and JSON schema and provides a simple and declarative way of describing forms. This reusable framework allows organizations to declare forms, including data-binding, input validation, and rule-based visibility.</p>\n<h2 id=\"Tutorial\">Tutorial</h2>\n<h3 id=\"Name-and-Version\">Name and Version</h3>\n<p>This is the survey protocol. It is uniquely identified by the URI:</p>\n<pre><code>\"https://didcomm.org/survey/1.0\"\n</code></pre>\n<h3 id=\"Key-Concepts\">Key Concepts</h3>\n<p>The protocol consists of a DIDComm request message carrying a JSON survey request to a responding agent, and a second message that carries the answers of the responder to the survey back to the client of the first message.</p>\n<h3 id=\"Basic-Walkthrough\">Basic Walkthrough</h3>\n<p>The survey protocol requires an active DIDComm connection before it can proceed. One agent behaves as a requester in the protocol and the other agent represents a responder. Conceptually the requester sends a message to the responder containing the survey (questions-schema, ui-schema, initial data, and internationalization data) which is rendered as a survey in the wallet of the responder. The responder can either decline the survey or complete the survey.</p>\n<p>The protocol can only be initiated by the requester by selecting the survey and connection. The protocol ends when the responder replies with an answer or declines. At any time a requester can send another survey to the connection.</p>\n<h3 id=\"Roles\">Roles</h3>\n<p>There are two parties in a typical survey interaction. The first party, <code>requester</code>, issues the survey with its schemata and the second party, <code>responder</code>, responds with the answer-data. The parties must have already exchanged pairwise keys and created a connection. These keys can be used to encrypt and verify the response. When the response is received by the requestion, the requestor can know with a high level of certainty that it was sent by responder.</p>\n<p>In this tutorial Alice (the <code>requester</code>) initiates the interaction, Alice creates the survey and sends it to Bob. The survey includes the questions, ui, initial data and i18n data.</p>\n<p>In this tutorial, Bob (the <code>responder</code>) receives the request and must respond to the survey (or decline it).</p>\n<h3 id=\"States\">States</h3>\n<p>This protocol follows the request-response protocol style and only requires the simple state of producing a conversational message and waiting for a response.</p>\n<p>The <code>abandoned</code> and <code>completed</code> states are terminal states and there is no expectation that the protocol can be continued after reaching those states.</p>\n<p>Either party may send a problem-report message earlier in the flow to terminate the protocol before its normal conclusion.</p>\n<h4 id=\"States-for-Requester\">States for Requester</h4>\n<p>The <code>requester</code> agent goes through the following states:</p>\n<ul>\n<li>request-sent</li>\n<li>completed</li>\n</ul>\n<p>The state transition table for the <code>requester</code> is:</p>\n<table>\n<thead>\n<tr>\n<th>State/Event</th>\n<th>Send Request</th>\n<th>Receive Response</th>\n<th>Send or Receive Problem Report</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><em>start</em></td>\n<td>Transition to <strong>request-sent</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>request-sent</td>\n<td></td>\n<td>Transition to <strong>completed</strong></td>\n<td>Transition to <strong>abandoned</strong></td>\n</tr>\n<tr>\n<td>completed</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>abandoned</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"States-for-Responder\">States for Responder</h4>\n<p>The <code>responder</code> agent goes through the following states:</p>\n<ul>\n<li>request-received</li>\n<li>completed</li>\n</ul>\n<p>The state transition table for the <code>responder</code> is:</p>\n<table>\n<thead>\n<tr>\n<th>State/Event</th>\n<th>Receive Request</th>\n<th>Send Response</th>\n<th>Send or Receive Problem Report</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><em>start</em></td>\n<td>Transition to <strong>request-received</strong></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>request-received</td>\n<td></td>\n<td>Transition to <strong>completed</strong></td>\n<td>Transition to <strong>abandoned</strong></td>\n</tr>\n<tr>\n<td>completed</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>abandoned</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p>After receiving a survey-request, the responder may send a problem-report to the requestor using the information in the request to decline (abandon) the protocol.</p>\n<h3 id=\"Messages\">Messages</h3>\n<h3 id=\"Survey-Request-Message\">Survey Request Message</h3>\n<p>The protocol begins when the <code>requester</code> sends a <code>survey-request</code> message to the responder:</p>\n<p>DIDComm V1 Example:</p>\n<pre><code class=\"language-json\">{\n    \"@type\": \"https://didcomm.org/survey/1.0/request\",\n    \"@id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"~thread\": {\n        \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\"\n    },\n    \"request\": {\n        \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n        \"survey_schema\": {\n            \"json_object\": \"json object defining the survey schema with the questions, answers and validations\"\n        },\n        \"ui_schema\": {\n            \"json_object\": \"json object defining the ui schema such as layout, controls, help text to aid rendering of the survey\"\n        },\n        \"init_data\": {\n            \"json_object\": \"json object containing the data to prefill answers\"\n        },\n        \"i18n_data\": {\n            \"json object\": \"json object containing the translations\"\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<p>The items in the message are as follows:</p>\n<ul>\n<li><code>@type</code> -- required, must be as above</li>\n<li><code>@id</code> -- required, must be as defined in [RFC 0005 DIDComm]</li>\n<li><code>~thread</code> -- required, must be as defined in [RFC 0008 Message ID and Threading]</li>\n<li><code>request</code> -- required, an item containing a JSONForms JSON structures. must be a single JSONForms request\n<ul>\n<li><code>survey_id</code> -- required, contains the survey identifier to uniquely identify the survey in the business logic</li>\n<li><code>survey_schema</code> -- required, contains the questions, answers and validations</li>\n<li><code>ui_schema</code> -- required, contains layout, controls, help labels</li>\n<li><code>init_data</code> -- optional, it can be used to prefill/preselect answers for questions in the survey</li>\n<li><code>i18n_data</code> -- optional, contains translations for the questions, answer options and labels</li>\n</ul>\n</li>\n<li><code>expires_time</code> is optional</li>\n</ul>\n<p>DIDComm V2 Example:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"request\": {\n            \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n            \"survey_schema\": {\n                \"json_object\": \"json object defining the survey schema with the questions, answers and validations\"\n            },\n            \"ui_schema\": {\n                \"json_object\": \"json object defining the ui schema such as layout, controls, help text to aid rendering of the survey\"\n            },\n            \"init_data\": {\n                \"json_object\": \"json object containing the data to prefill answers\"\n            },\n            \"i18n_data\": {\n                \"json object\": \"json object containing the translations\"\n            }\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<h4 id=\"Example-Request-Message-with-a-survey\">Example Request Message with a survey</h4>\n<p>The survey is declared as JSON objects in the Survey Request Message. In this example, we use a survey_schema which is an <code>object</code> with three properties <code>name</code>, <code>birthDate</code> and <code>nationality</code>.</p>\n<p>Survey Schema:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n      \"name\": {\n        \"type\": \"string\",\n        \"minLength\": 3,\n        \"description\": \"Please enter your name\"\n      },\n      \"birthDate\": {\n        \"type\": \"string\",\n        \"format\": \"date\"\n      },\n      \"nationality\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"DE\",\n          \"IT\",\n          \"JP\",\n          \"US\",\n          \"NL\",\n          \"Other\"\n        ]\n      }\n    },\n    \"required\": [\n      \"name\",\n      \"nationality\"\n    ]\n  }\n</code></pre>\n<p>The UI schema describes the general layout of the survey. It is a JSON object that defines the controls, layouts (horizontal, vertical, groups) and rules.</p>\n<p>UI Schema:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"HorizontalLayout\",\n    \"elements\": [\n        {\n            \"type\": \"Control\",\n            \"label\": \"Name\",\n            \"scope\": \"#/properties/name\"\n        },\n        {\n            \"type\": \"Control\",\n            \"label\": \"Birth Date\",\n            \"scope\": \"#/properties/birthDate\"\n        },\n        {\n            \"type\": \"Control\",\n            \"scope\": \"#/properties/nationality\"\n        }\n    ]\n}\n</code></pre>\n<p>The <code>init_data</code> represents an object containing the data to be rendered in the survey. This can be used to prepopulate the form with data.</p>\n<p>Initial Data:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"John Doe\",\n  \"birthDate\": \"1985-06-02\"\n}\n</code></pre>\n<p>Provides internationalization data for handling the translations (and to render locale specific UI elements, e.g. formatting of numbers). This example translates the Survey <code>title</code>, <code>description</code> and <code>name</code> property.</p>\n<p>I18n Data:</p>\n<pre><code class=\"language-json\">{\n    \"English\": {\n        \"title\": \"Hello\",\n        \"description\": \"Test\",\n        \"name\": {\n            \"label\": \"What is your name?\"\n        }\n    },\n    \"Spanish\": {\n        \"title\": \"Hola\",\n        \"description\": \"Test\",\n        \"name\": {\n            \"label\": \"Que es nombre?\"\n        }\n    }\n}\n</code></pre>\n<p>Full example Survey request message:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"request\": {\n            \"survey_id\": \"750d9731-562b-f8a9-48df-89b12a1ec7f3\",\n            \"survey_schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\n                        \"type\": \"string\",\n                        \"minLength\": 3,\n                        \"description\": \"Please enter your name\"\n                    },\n                    \"birthDate\": {\n                        \"type\": \"string\",\n                        \"format\": \"date\"\n                    },\n                    \"nationality\": {\n                        \"type\": \"string\",\n                        \"enum\": [\n                            \"DE\",\n                            \"IT\",\n                            \"JP\",\n                            \"US\",\n                            \"NL\",\n                            \"Other\"\n                        ]\n                    }\n                },\n                \"required\": [\n                    \"name\",\n                    \"nationality\"\n                ]\n            },\n            \"ui_schema\": {\n                \"type\": \"HorizontalLayout\",\n                \"elements\": [\n                    {\n                        \"type\": \"Control\",\n                        \"label\": \"Name\",\n                        \"scope\": \"#/properties/name\"\n                    },\n                    {\n                        \"type\": \"Control\",\n                        \"label\": \"Birth Date\",\n                        \"scope\": \"#/properties/birthDate\"\n                    },\n                    {\n                        \"type\": \"Control\",\n                        \"scope\": \"#/properties/nationality\"\n                    }\n                ]\n            }\n        },\n        \"init_data\": {\n            \"name\": \"John Doe\",\n            \"birthDate\": \"1985-06-02\"\n        },\n        \"i18n_data\": {\n            \"English\": {\n                \"title\": \"Hello\",\n                \"description\": \"Test\",\n                \"name\": {\n                    \"label\": \"What is your name?\"\n                }\n            },\n            \"Spanish\": {\n                \"title\": \"Hola\",\n                \"description\": \"Test\",\n                \"name\": {\n                    \"label\": \"Que es nombre?\"\n                }\n            }\n        }\n    },\n    \"expires_time\": \"2018-12-13T17:29:06+0000\"\n}\n</code></pre>\n<h3 id=\"Survey-Response-Message\">Survey Response Message</h3>\n<p>A <code>response</code> message is sent by the <code>responder</code> following the completion of the survey to convey the answers to the requester.</p>\n<p>If the <code>request</code> is unrecognizable as a JSONForms survey such that a survey cannot be rendered, the server SHOULD send a [RFC 0035 Report Problem] message to the client.</p>\n<p>DIDComm V1 Example:</p>\n<pre><code class=\"language-json\">{\n    \"@type\": \"https://didcomm.org/survey/1.0/request\",\n    \"@id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"~thread\": {\n        \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\"\n    },\n    \"response\": {\n        \"response_type\": \"data\",\n        \"data\": {\n            \"json_object\": \"json object containing the answers given by the responder\"\n        },\n    },\n}\n</code></pre>\n<p>DIDComm V2 Example:</p>\n<pre><code class=\"language-json\">{\n    \"type\": \"https://didcomm.org/survey/1.0/request\",\n    \"id\": \"8192855c-89f3-5bb5-4971-7be10cbc6c71\",\n    \"thid\": \"5689db78-5123-2aad-448d-0203107fee11\",\n    \"body\": {\n        \"response\": {\n            \"response_type\": \"data\",\n            \"data\": {\n                \"json_object\": \"json object containing the answers given by the responder\"\n            }\n        }\n    }\n}\n</code></pre>\n<p>The items in the message are as follows:</p>\n<ul>\n<li><code>@type</code> -- required, must be as above</li>\n<li><code>@id</code> -- required, must be as defined in [RFC 0005 DIDComm]</li>\n<li><code>~thread</code> -- required, must be as defined in [RFC 0008 Message ID and Threading], same as the request</li>\n<li><code>request</code> -- required, an item containing a JSONForm as JSON objects. must be a single JSONForms request\n<ul>\n<li><code>response_type</code> -- required, the type of response, must be <code>data</code> if the survey was completed and returns the answer data. If the responder declines the survey the <code>response_type</code> must be <code>decline</code></li>\n<li><code>data</code> -- required, if <code>response_type</code> is <code>data</code> and will contain the answers provided by the responder, optional with other <code>response_type</code>'s. And will follow the same object structure as the <code>init_data</code> in the Request</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"Problem-Report-Message\">Problem Report Message</h3>\n<p>A [RFC 0035 Report Problem] message SHOULD be sent by the responder instead of a response message only if the request is unrecognizable as a JSONForms message.</p>\n<h2 id=\"L10n\">L10n</h2>\n<p>Translations for the survey are provided in the i18n_data attribute of the survey request message.</p>\n<h2 id=\"Prior-art\">Prior art</h2>\n<p>This protocol has similar goals to the <a href=\"https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md\">RFC 0113 Question &amp; Answer</a> DIDComm protocol, but changes the approach to more complex use cases where the business case requires a broader set of questions and answers for a larger set of respondents. This Survey protocol can be used for multiple questions and answers in a single form (i.e. surveys) and in a more asynchronous environment (a -nearly- synchronous response is not expected). Surveys would typically be used to gather data from a group of people, unlike Question and Answer which appears to be more directed at a single respondent in a specific context.</p>\n<h2 id=\"Implementations\">Implementations</h2>\n<p>The following lists the implementations (if any) of this RFC. Please do a pull request to add your implementation. If the implementation is open source, include a link to the repo or to the implementation within the repo. Please be consistent in the \"Name\" field so that a mechanical processing of the RFCs can generate a list of all RFCs supported by an Aries implementation.</p>\n<table>\n<thead>\n<tr>\n<th>Name / Link</th>\n<th>Implementation Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"https://github.com/Entidad/credo-ts-survey\">credo-ts-survey</a></td>\n<td>Credo extension library</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/openwallet-foundation-labs/farmworker-wallet-os\">farmworker-wallet-os</a></td>\n<td>Farmworker Wallet OS, Credo SDK for Mendix low-code platform</td>\n</tr>\n</tbody>\n</table>"}},
    "staticQueryHashes": ["3000541721","3766577012"],
    "matchPath": "survey/1.0/*"}