PROBLEM

Unable to view attachments via the URLs copied from the ArcGIS Survey123 website in ArcGIS Online

Last Published: June 24, 2024

Description

In ArcGIS Online, on the Data tab of a hosted feature layer, clicking an attachment URL copied from the ArcGIS Survey123 website in the attribute table redirects to the ArcGIS REST Services Directory and returns the following error message:

Error: 
Invalid token.
The error message

Cause

The token required to access secure content and resources such as attachments on the feature service has expired. When accessing attachments of a feature through other applications such as ArcGIS Online Map Viewer, a token is automatically added to the URL. ArcGIS tokens have an expiration for security purposes, as it ensures limited access within the organization for items not publicly shared. When using the URL to embed secured content for indefinite use, the URL with token enabled is not optimal as it is bound to expire and the item will no longer be available for viewing. 

Solution or Workaround

The steps below describe the best practice to obtain the attachment URL collected via the Survey123 survey to be stored in the attribute table of the hosted feature layer in ArcGIS Online.

  1. Export the survey data as a file geodatabase from the ArcGIS Survey123 website.
    1. Open the ArcGIS Survey123 website. Sign in to the ArcGIS organizational account.
    2. Click the survey containing the attachments.
    3. Click Data to open the Data page.
    4. Click Export > File Geodatabase.
  1. Create a new project in ArcGIS Pro. Refer to ArcGIS Pro: Create a project from a default template for instructions.
  2. Add the file geodatabase folder to the project. Refer to ArcGIS Pro: Connect to an existing folder for instructions.
  3. Export the attachments from the file geodatabase. Refer to How to: Batch export attachments from a feature class in ArcGIS Pro for instructions. Alternatively, use the Export Attachments tool.
Note: 
The Export Attachment tool is available in ArcGIS Pro 3.3 and later.
  1. Upload the exported attachment file to ArcGIS Online as an item. Refer to ArcGIS Online: Add files as items for instructions.
  2. Share the item publicly. Refer to ArcGIS Online: Share items with everyone for instructions.
  3. Copy the URL from the item details page.
    1. On the Content tab, click the item to open the item details page.
    2. On the Overview tab, scroll down to the bottom of the page.
    3. Click Copy The Copy icon below URL to copy the item's URL and use the URL in the attribute table of the hosted feature layer on the Data tab to display the attachment when clicked.

Article ID: 000032764

Software:
  • ArcGIS Online
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 3
  • ArcGIS Survey123
  • ArcGIS Pro 3 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options