Encode URL Parameters

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://survey123.arcgis.com/share/<surveyItemId>?code=<url parameters code>.

URL:https://survey123.arcgis.com/api/encodeUrlParams
Method:POST only
Privilege:None
Operation:None

Request parameters

ParameterRequiredDetails
tokentrueAn access token that identifies the authenticated user with the portal.
paramstrueAn object containing the URL parameters that are to be encoded. See Parameters for web app for details on the parameters supported.
portalUrlfalseURL of the portal. If not supplied, default is https://www.arcgis.com/.
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
    "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.

Use dark colors for code blocksCopy
1
2
3
4
{
  "code": "ShBmaWVsZDpjdXNUcmFja05vchRmaWVsZDpjdXNUcmFja05vPTEyMw==",
  "success": true
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.