When creating a Survey123 link dynamically, or if you are manually creating many Survey123 links, you can use encodeUrlParams to programmatically encode the included URL parameters.
The encodeUrlParams operation allows you to pass a collection of Survey123 parameters and an encoded URL string is returned. It is not necessary to include any information about your survey, only the URL parameters that you wish to encode and a token are required. The portalUrl parameter is only needed if you are working against ArcGIS Enterprise.
Once the encoded URL parameters string is returned, it can be appended to a survey URL separated by a question mark symbol using the following syntax, https
.
URL: | https://survey123.arcgis.com/api/encodeUrlParams |
Method: | POST only |
Privilege: | None |
Operation: | None |
Request parameters
Parameter | Required | Details |
---|---|---|
token | true | An access token that identifies the authenticated user with the portal. |
params | true | An object containing the URL parameters that are to be encoded. See Parameters for web app for details on the parameters supported. |
portalUrl | false | URL of the portal. If not supplied, default is https://www.arcgis.com/. |
{
"token": "<TOKEN>",
"params": {
"field:submittedBy": "John Smith",
"hide": ["field: submittedBy"]
},
"portalUrl": "<Portal URL>",
}
Response example
A JSON object which contains the property code which represents your URL parameters encoded.
{
"code": "ShBmaWVsZDpjdXNUcmFja05vchRmaWVsZDpjdXNUcmFja05vPTEyMw==",
"success": true
}