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 |
---|---|
System.Threading.Tasks.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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.15 |
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 |
---|---|
System.Threading.Tasks.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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |
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 |
---|---|---|
System.String | folderId | The Id of the folder for which to get content. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.15 |
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 |
---|---|---|
System.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 |
---|---|
System.Threading.Tasks.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
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |