Show / Hide Table of Contents

Method GetContentAsync

GetContentAsync()

Gets the folders and items that are stored at the user's root folder.

Declaration
public Task<PortalUserContent> GetContentAsync()
Returns
Type Description
Task<PortalUserContent>

The task object representing the asynchronous get items operation. The value of the task result contains a PortalUserContent object.

Remarks

The purpose of this Method is to obtain content (items and folders) that belong to a particular authenticated user in a portal. This method performs an asynchronous request to obtain a PortalUserContent object for the logged in user. You cannot use anonymous access to obtain a Portal.PortalUser object and use this Method to obtain valid results. As AGOL/ArcGIS Portal require the use of long term tokens to access secured user information.

To retrieve portal items from folders other than the root use GetContentAsync(String, CancellationToken).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0

GetContentAsync(CancellationToken)

Gets the folders and items that are stored at the user's root folder.

Declaration
public async Task<PortalUserContent> GetContentAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken

A CancellationToken with which to cancel the operation if required.

Returns
Type Description
Task<PortalUserContent>

The task object representing the asynchronous get items operation. The value of the task result contains a PortalUserContent object.

Remarks

The purpose of this Method is to obtain content (items and folders) that belong to a particular authenticated user in a portal. This method performs an asynchronous request to obtain a PortalUserContent object for the logged in user. You cannot use anonymous access to obtain a Portal.PortalUser object and use this Method to obtain valid results. As AGOL/ArcGIS Portal require the use of long term tokens to access secured user information.

To retrieve portal items from folders other than the root use GetContentAsync(String, CancellationToken).

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.14
iOS100.0 - 100.15
UWP100.0 - 200.0

GetContentAsync(String)

Gets portal items stored in the specified folder belonging to this user.

Declaration
public Task<IEnumerable<PortalItem>> GetContentAsync(string folderId)
Parameters
Type Name Description
String folderId

The Id of the folder for which to get content.

Returns
Type Description
Task<IEnumerable<PortalItem>>

The task object representing the asynchronous get items operation. The value of the task result contains a collection of PortalItem objects.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0

GetContentAsync(String, CancellationToken)

Gets portal items stored in the specified folder belonging to this user.

Declaration
public async Task<IEnumerable<PortalItem>> GetContentAsync(string folderId, CancellationToken cancellationToken)
Parameters
Type Name Description
String folderId

The Id of the folder for which to get content.

CancellationToken cancellationToken

A CancellationToken with which to cancel the operation if required.

Returns
Type Description
Task<IEnumerable<PortalItem>>

The task object representing the asynchronous get items operation. The value of the task result contains a collection of PortalItem objects.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.14
iOS100.0 - 100.15
UWP100.0 - 200.0
In This Article
Back to top Copyright © 2022 Esri.