Show / Hide Table of Contents

Interface IContentfulManagementClient

Interface for methods to interact with the Contentful Management API.

Namespace:Contentful.Core
Assembly:cs.temp.dll.dll
Syntax
public interface IContentfulManagementClient

Methods

ActivateContentType(String, Int32, String, CancellationToken)

Activates a ContentType by the specified id.

Declaration
Task<ContentType> ActivateContentType(string contentTypeId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type.

System.Int32 version

The last known version of the content type.

System.String spaceId

The id of the space to activate the content type in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentType>

The response from the API serialized into a ContentType.

ArchiveAsset(String, Int32, String, CancellationToken)

Archives an asset by the specified id.

Declaration
Task<ManagementAsset> ArchiveAsset(string assetId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to archive.

System.Int32 version

The last known version of the asset.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset archived.

ArchiveEntry(String, Int32, String, CancellationToken)

Archives an entry by the specified id.

Declaration
Task<Entry<dynamic>> ArchiveEntry(string entryId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.Int32 version

The last known version of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The response from the API serialized into Entry<T>

CreateApiKey(String, String, String, CancellationToken)

Creates an ApiKey in a space.

Declaration
Task<ApiKey> CreateApiKey(string name, string description, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String name

The name of the API key to create.

System.String description

The description of the API key to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ApiKey>

The created ApiKey.

CreateAsset(ManagementAsset, String, CancellationToken)

Creates an ManagementAsset with a randomly created id.

Declaration
Task<ManagementAsset> CreateAsset(ManagementAsset asset, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
ManagementAsset asset

The asset to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The created ManagementAsset

CreateEntry(Entry<Object>, String, String, CancellationToken)

Creates an Entry<T>.

Declaration
Task<Entry<dynamic>> CreateEntry(Entry<dynamic> entry, string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Entry<System.Object> entry

The entry to create or update.

System.String contentTypeId

The id of the ContentType of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The created Entry<T>.

CreateEntry<T>(T, String, String, CancellationToken)

Creates an entry.

Declaration
Task<T> CreateEntry<T>(T entry, string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
T entry

The object to create an entry from.

System.String contentTypeId

The id of the ContentType of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<T>

The created entry.

Type Parameters
Name Description
T

CreateEntryForLocale(Object, String, String, String, String, CancellationToken)

Creates an entry with values for a certain locale from the provided object.

Declaration
Task<Entry<dynamic>> CreateEntryForLocale(object entry, string id, string contentTypeId, string locale = null, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Object entry

The object to use as values for the entry fields.

System.String id

The of the entry to create.

System.String contentTypeId

The id of the content type to create an entry for.

System.String locale

The locale to set fields for. The default locale for the space will be used if this parameter is null or empty.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The created Entry<T>.

CreateEnvironment(String, String, CancellationToken)

Creates a ContentfulEnvironment for a space.

Declaration
Task<ContentfulEnvironment> CreateEnvironment(string name, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String name

The name of the environment.

System.String spaceId

The id of the space to create an environment in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulEnvironment>

The created ContentfulEnvironment.

Exceptions
Type Condition
System.ArgumentException

The required arguments were not provided.

ContentfulException

There was an error when communicating with the Contentful API.

CreateExtension(UiExtension, String, CancellationToken)

Creates a UiExtension in a Space.

Declaration
Task<UiExtension> CreateExtension(UiExtension extension, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
UiExtension extension

The UI extension to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<UiExtension>

The created UiExtension.

CreateLocale(Locale, String, CancellationToken)

Creates a locale in the specified Space.

Declaration
Task<Locale> CreateLocale(Locale locale, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Locale locale

The Locale to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Locale>

The created Locale.

CreateManagementToken(ManagementToken, CancellationToken)

Creates a CMA management token that can be used to access the Contentful Management API.

Declaration
Task<ManagementToken> CreateManagementToken(ManagementToken token, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
ManagementToken token

The token to create.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementToken>

The created ManagementToken.

CreateOrganizationMembership(String, String, String, Boolean, CancellationToken)

Creates a membership in an Organization.

Declaration
Task<OrganizationMembership> CreateOrganizationMembership(string organizationId, string role, string email, bool suppressInvitation, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String organizationId

The id of the organization to create a membership in.

System.String role

The role the membership should have for that organization.

System.String email

The email address of the membership.

System.Boolean suppressInvitation

Whether or not to suppress the invitation email.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<OrganizationMembership>

The created OrganizationMembership.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

CreateOrUpdateAsset(ManagementAsset, String, Nullable<Int32>, CancellationToken)

Creates or updates an ManagementAsset. Updates if an asset with the same id already exists.

Declaration
Task<ManagementAsset> CreateOrUpdateAsset(ManagementAsset asset, string spaceId = null, int? version = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
ManagementAsset asset

The asset to create or update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Nullable<System.Int32> version

The last known version of the entry. Must be set when updating an asset.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The updated ManagementAsset

CreateOrUpdateContentType(ContentType, String, Nullable<Int32>, CancellationToken)

Creates or updates a ContentType. Updates if a content type with the same id already exists.

Declaration
Task<ContentType> CreateOrUpdateContentType(ContentType contentType, string spaceId = null, int? version = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
ContentType contentType

The ContentType to create or update. Remember to set the id property.

System.String spaceId

The id of the space to create the content type in. Will default to the one set when creating the client.

System.Nullable<System.Int32> version

The last version known of the content type. Must be set for existing content types. Should be null if one is created.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentType>

The created or updated ContentType.

CreateOrUpdateEntry(Entry<Object>, String, String, Nullable<Int32>, CancellationToken)

Creates or updates an Entry<T>. Updates if an entry with the same id already exists.

Declaration
Task<Entry<dynamic>> CreateOrUpdateEntry(Entry<dynamic> entry, string spaceId = null, string contentTypeId = null, int? version = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Entry<System.Object> entry

The entry to create or update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.String contentTypeId

The id of the ContentType of the entry. Need only be set if you are creating a new entry.

System.Nullable<System.Int32> version

The last known version of the entry. Must be set when updating an entry.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The created or updated Entry<T>.

CreateOrUpdateEntry<T>(T, String, String, String, Nullable<Int32>, CancellationToken)

Creates or updates an entry. Updates if an entry with the same id already exists.

Declaration
Task<T> CreateOrUpdateEntry<T>(T entry, string id, string spaceId = null, string contentTypeId = null, int? version = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
T entry

The entry to create or update.

System.String id

The id of the entry to create or update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.String contentTypeId

The id of the ContentType of the entry. Need only be set if you are creating a new entry.

System.Nullable<System.Int32> version

The last known version of the entry. Must be set when updating an entry.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<T>

The created or updated entry.

Type Parameters
Name Description
T

CreateOrUpdateEnvironment(String, String, Nullable<Int32>, String, CancellationToken)

Creates a ContentfulEnvironment for a space.

Declaration
Task<ContentfulEnvironment> CreateOrUpdateEnvironment(string id, string name, int? version = default(int? ), string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the environment to create.

System.String name

The name of the environment.

System.Nullable<System.Int32> version

The last known version of the environment. Must be set when updating an environment.

System.String spaceId

The id of the space to create an environment in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulEnvironment>

The created ContentfulEnvironment.

Exceptions
Type Condition
System.ArgumentException

The required arguments were not provided.

ContentfulException

There was an error when communicating with the Contentful API.

CreateOrUpdateExtension(UiExtension, String, Nullable<Int32>, CancellationToken)

Creates or updates a UI extension. Updates if an extension with the same id already exists.

Declaration
Task<UiExtension> CreateOrUpdateExtension(UiExtension extension, string spaceId = null, int? version = default(int? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
UiExtension extension

The UiExtension to create or update. Remember to set the id property.

System.String spaceId

The id of the space to create the content type in. Will default to the one set when creating the client.

System.Nullable<System.Int32> version

The last version known of the extension. Must be set for existing extensions. Should be null if one is created.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<UiExtension>

The created or updated UiExtension.

CreateOrUpdateWebhook(Webhook, String, CancellationToken)

Creates or updates a webhook in a Space. Updates if a webhook with the same id already exists.

Declaration
Task<Webhook> CreateOrUpdateWebhook(Webhook webhook, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Webhook webhook

The webhook to create or update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Webhook>

The created Webhook.

CreateRole(Role, String, CancellationToken)

Creates a role in a Space.

Declaration
Task<Role> CreateRole(Role role, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Role role

The role to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Role>

The created Role.

CreateSpace(String, String, String, CancellationToken)

Creates a new space in Contentful.

Declaration
Task<Space> CreateSpace(string name, string defaultLocale, string organisation = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String name

The name of the space to create.

System.String defaultLocale

The default locale for this space.

System.String organisation

The organisation to create a space for. Not required if the account belongs to only one organisation.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Space>

The created Space

CreateSpaceMembership(SpaceMembership, String, CancellationToken)

Creates a membership in a Space.

Declaration
Task<SpaceMembership> CreateSpaceMembership(SpaceMembership spaceMembership, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
SpaceMembership spaceMembership

The membership to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<SpaceMembership>

The created SpaceMembership.

CreateWebhook(Webhook, String, CancellationToken)

Creates a webhook in a Space.

Declaration
Task<Webhook> CreateWebhook(Webhook webhook, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Webhook webhook

The webhook to create.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Webhook>

The created Webhook.

DeactivateContentType(String, String, CancellationToken)

Deactivates a ContentType by the specified id.

Declaration
Task DeactivateContentType(string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type.

System.String spaceId

The id of the space to deactivate the content type in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

The response from the API serialized into a ContentType.

DeleteApiKey(String, String, CancellationToken)

Deletes an api key by the specified id.

Declaration
Task DeleteApiKey(string apiKeyId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String apiKeyId

The id of the api key to delete.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

A SystemProperties with metadata of the upload.

DeleteAsset(String, Int32, String, CancellationToken)

Deletes an asset by the specified id.

Declaration
Task DeleteAsset(string assetId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to delete.

System.Int32 version

The last known version of the asset.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteContentType(String, String, CancellationToken)

Deletes a ContentType by the specified id.

Declaration
Task DeleteContentType(string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type.

System.String spaceId

The id of the space to delete the content type in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

The response from the API serialized into a ContentType.

DeleteEntry(String, Int32, String, CancellationToken)

Deletes a single entry by the specified id.

Declaration
Task DeleteEntry(string entryId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.Int32 version

The last known version of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteEnvironment(String, String, CancellationToken)

Deletes a ContentfulEnvironment for a space.

Declaration
Task DeleteEnvironment(string id, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the environment to delete.

System.String spaceId

The id of the space to get an environment in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

The ContentfulEnvironment.

Exceptions
Type Condition
System.ArgumentException

The required arguments were not provided.

ContentfulException

There was an error when communicating with the Contentful API.

DeleteExtension(String, String, CancellationToken)

Deletes a UiExtension by the specified id.

Declaration
Task DeleteExtension(string extensionId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String extensionId

The id of the extension.

System.String spaceId

The id of the space to delete the extension in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteLocale(String, String, CancellationToken)

Deletes a locale by the specified id.

Declaration
Task DeleteLocale(string localeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String localeId

The id of the locale to delete.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteOrganizationMembership(String, String, CancellationToken)

Deletes a OrganizationMembership for a space.

Declaration
Task DeleteOrganizationMembership(string membershipId, string organizationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String membershipId

The id of the organization membership to delete.

System.String organizationId

The id of the organization.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentException

The membershipId parameter was null or empty.

ContentfulException

There was an error when communicating with the Contentful API.

DeleteRole(String, String, CancellationToken)

Deletes a role by the specified id.

Declaration
Task DeleteRole(string roleId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String roleId

The id of the role to delete.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteSpace(String, CancellationToken)

Deletes a space in Contentful.

Declaration
Task DeleteSpace(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the space to delete.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteSpaceMembership(String, String, CancellationToken)

Deletes a SpaceMembership for a space.

Declaration
Task DeleteSpaceMembership(string spaceMembershipId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceMembershipId

The id of the space membership to delete.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

DeleteUpload(String, String, CancellationToken)

Gets an upload SystemProperties by the specified id.

Declaration
Task DeleteUpload(string uploadId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String uploadId

The id of the uploaded file.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

A SystemProperties with metadata of the upload.

DeleteWebhook(String, String, CancellationToken)

Deletes a webhook from a Space.

Declaration
Task DeleteWebhook(string webhookId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String webhookId

The id of the webhook to delete.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

GetActivatedContentTypes(String, CancellationToken)

Get all activated content types of a space.

Declaration
Task<IEnumerable<ContentType>> GetActivatedContentTypes(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space to get the activated content types of. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ContentType>>

An System.Collections.Generic.IEnumerable<T> of ContentType.

GetAllApiKeys(String, CancellationToken)

Gets a collection of all ApiKey in a space.

Declaration
Task<ContentfulCollection<ApiKey>> GetAllApiKeys(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ApiKey>>

A ContentfulCollection<T> of ApiKey.

GetAllExtensions(String, CancellationToken)

Gets a collection of all UiExtension for a space.

Declaration
Task<ContentfulCollection<UiExtension>> GetAllExtensions(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<UiExtension>>

A ContentfulCollection<T> of UiExtension.

GetAllManagementTokens(CancellationToken)

Gets a collection of all ManagementToken for a user. Note that the actual token will not be part of the response. It is only available directly after creation of a token for security reasons.

Declaration
Task<ContentfulCollection<ManagementToken>> GetAllManagementTokens(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ManagementToken>>

A ContentfulCollection<T> of UiExtension.

GetAllPreviewApiKeys(String, CancellationToken)

Gets a collection of all preview ApiKey in a space.

Declaration
Task<ContentfulCollection<ApiKey>> GetAllPreviewApiKeys(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ApiKey>>

A ContentfulCollection<T> of ApiKey.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetAllRoles(String, CancellationToken)

Gets all Role of a space.

Declaration
Task<ContentfulCollection<Role>> GetAllRoles(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<Role>>

A ContentfulCollection<T> of Role.

GetAllSnapshotsForContentType(String, String, CancellationToken)

Gets all snapshots for a ContentType.

Declaration
Task<ContentfulCollection<SnapshotContentType>> GetAllSnapshotsForContentType(string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type to get snapshots for.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<SnapshotContentType>>

A collection of SnapshotContentType.

GetAllSnapshotsForEntry(String, String, CancellationToken)

Gets all snapsohts for an Entry<T>.

Declaration
Task<ContentfulCollection<Snapshot>> GetAllSnapshotsForEntry(string entryId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry to get snapshots for.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<Snapshot>>

A collection of Snapshot.

GetAllUsers(String, CancellationToken)

Gets a collection of all User in a space.

Declaration
Task<ContentfulCollection<User>> GetAllUsers(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<User>>

A ContentfulCollection<T> of ApiKey.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetApiKey(String, String, CancellationToken)

Gets an ApiKey in a space.

Declaration
Task<ApiKey> GetApiKey(string apiKeyId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String apiKeyId

The id of the api key get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ApiKey>

A ContentfulCollection<T> of ApiKey.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetAsset(String, String, CancellationToken)

Gets an asset by the specified id.

Declaration
Task<ManagementAsset> GetAsset(string assetId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset.

GetAssetsCollection(QueryBuilder<Asset>, String, CancellationToken)

Gets all assets of a space, filtered by an optional QueryBuilder<T>.

Declaration
Task<ContentfulCollection<ManagementAsset>> GetAssetsCollection(QueryBuilder<Asset> queryBuilder, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
QueryBuilder<Asset> queryBuilder

The optional QueryBuilder<T> to add additional filtering to the query.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ManagementAsset>>

A ContentfulCollection<T> of ManagementAsset.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetAssetsCollection(String, String, CancellationToken)

Gets all assets in the space.

Declaration
Task<ContentfulCollection<ManagementAsset>> GetAssetsCollection(string queryString, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String queryString

The optional querystring to add additional filtering to the query.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ManagementAsset>>

A ContentfulCollection<T> of ManagementAsset.

GetContentType(String, String, CancellationToken)

Gets a ContentType by the specified id.

Declaration
Task<ContentType> GetContentType(string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type.

System.String spaceId

The id of the space to get the content type from. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentType>

The response from the API serialized into a ContentType.

GetContentTypes(String, CancellationToken)

Get all content types of a space.

Declaration
Task<IEnumerable<ContentType>> GetContentTypes(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space to get the content types of. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ContentType>>

An System.Collections.Generic.IEnumerable<T> of ContentType.

GetCurrentUser(CancellationToken)

Gets a single User for the currently logged in user.

Declaration
Task<User> GetCurrentUser(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<User>

The User.

GetEditorInterface(String, String, CancellationToken)

Gets a EditorInterface for a specific ContentType.

Declaration
Task<EditorInterface> GetEditorInterface(string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String contentTypeId

The id of the content type.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<EditorInterface>

The response from the API serialized into a EditorInterface.

GetEntriesCollection<T>(QueryBuilder<T>, CancellationToken)

Gets all the entries of a space, filtered by an optional QueryBuilder<T>.

Declaration
Task<ContentfulCollection<T>> GetEntriesCollection<T>(QueryBuilder<T> queryBuilder, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
QueryBuilder<T> queryBuilder

The optional QueryBuilder<T> to add additional filtering to the query.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<T>>

A ContentfulCollection<T> of items.

Type Parameters
Name Description
T

The IContentfulResource to serialize the response into.

GetEntriesCollection<T>(String, CancellationToken)

Gets all the entries of a space, filtered by an optional querystring. A simpler approach than to construct a query manually is to use the QueryBuilder<T> class.

Declaration
Task<ContentfulCollection<T>> GetEntriesCollection<T>(string queryString = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String queryString

The optional querystring to add additional filtering to the query.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<T>>

A ContentfulCollection<T> of items.

Type Parameters
Name Description
T

The IContentfulResource to serialize the response into.

GetEntriesForLocale<T>(QueryBuilder<T>, String, String, CancellationToken)

Gets all the entries of a space in a specific locale, filtered by an optional QueryBuilder<T>.

Declaration
Task<ContentfulCollection<T>> GetEntriesForLocale<T>(QueryBuilder<T> queryBuilder, string locale = null, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
QueryBuilder<T> queryBuilder

The optional QueryBuilder<T> to add additional filtering to the query.

System.String locale

The locale to fetch entries for. Defaults to the default of the space.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<T>>

A ContentfulCollection<T> of items.

Type Parameters
Name Description
T

GetEntry(String, String, CancellationToken)

Get a single entry by the specified id.

Declaration
Task<Entry<dynamic>> GetEntry(string entryId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The response from the API serialized into Entry<T>

GetEnvironment(String, String, CancellationToken)

Gets a ContentfulEnvironment for a space.

Declaration
Task<ContentfulEnvironment> GetEnvironment(string id, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the environment to get.

System.String spaceId

The id of the space to get an environment in. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulEnvironment>

The ContentfulEnvironment.

Exceptions
Type Condition
System.ArgumentException

The required arguments were not provided.

ContentfulException

There was an error when communicating with the Contentful API.

GetEnvironments(String, CancellationToken)

Gets a collection of all ContentfulEnvironment for a space.

Declaration
Task<ContentfulCollection<ContentfulEnvironment>> GetEnvironments(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space to get environments for. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ContentfulEnvironment>>

A ContentfulCollection<T> of ContentfulEnvironment.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetExtension(String, String, CancellationToken)

Gets a single UiExtension for a space.

Declaration
Task<UiExtension> GetExtension(string extensionId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String extensionId

The id of the extension to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<UiExtension>

The User.

GetLocale(String, String, CancellationToken)

Gets a locale in the specified Space.

Declaration
Task<Locale> GetLocale(string localeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String localeId

The id of the locale to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Locale>

The requested Locale.

GetLocalesCollection(String, CancellationToken)

Gets all locales in a Space.

Declaration
Task<ContentfulCollection<Locale>> GetLocalesCollection(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<Locale>>

A ContentfulCollection<T> of locales.

GetManagementToken(String, CancellationToken)

Gets a single ManagementToken for a user. Note that the actual token will not be part of the response. It is only available directly after creation of a token for security reasons.

Declaration
Task<ManagementToken> GetManagementToken(string managementTokenId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String managementTokenId

The id of the management token to get.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementToken>

The ManagementToken.

GetOrganizationMembership(String, String, CancellationToken)

Gets a single OrganizationMembership for a space.

Declaration
Task<OrganizationMembership> GetOrganizationMembership(string membershipId, string organizationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String membershipId

The id of the membership to get.

System.String organizationId

The id of the organization.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<OrganizationMembership>

The SpaceMembership.

Exceptions
Type Condition
System.ArgumentException

The spaceMembershipId parameter was null or empty.

ContentfulException

There was an error when communicating with the Contentful API.

GetOrganizationMemberships(String, String, CancellationToken)

Gets a collection of OrganizationMembership for the specified organization.

Declaration
Task<ContentfulCollection<OrganizationMembership>> GetOrganizationMemberships(string organizationId, string queryString = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String organizationId

The id of the organization.

System.String queryString

The optional querystring to add additional filtering to the query.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<OrganizationMembership>>

A collection of OrganizationMembership.

GetOrganizations(CancellationToken)

Gets a collection of all Organization for a user.

Declaration
Task<ContentfulCollection<Organization>> GetOrganizations(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<Organization>>

A ContentfulCollection<T> of Organization.

GetPreviewApiKey(String, String, CancellationToken)

Gets a preview ApiKey in a space.

Declaration
Task<ApiKey> GetPreviewApiKey(string apiKeyId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String apiKeyId

The id of the api key get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ApiKey>

A ContentfulCollection<T> of ApiKey.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetPublishedAssetsCollection(String, CancellationToken)

Gets all published assets in the space.

Declaration
Task<ContentfulCollection<ManagementAsset>> GetPublishedAssetsCollection(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ManagementAsset>>

A ContentfulCollection<T> of ManagementAsset.

GetResourceUsage(String, String, String, CancellationToken)

Gets a collection of ApiUsage for an organization.

Declaration
Task<ContentfulCollection<ApiUsage>> GetResourceUsage(string organizationId, string type, string queryString = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String organizationId

The id of the organization to get usage for.

System.String type

The type of resource to get usage for, organization or space.

System.String queryString

The optional querystring to add additional filtering to the query.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<ApiUsage>>

A ContentfulCollection<T> of ApiUsage.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetRole(String, String, CancellationToken)

Gets a role by the specified id.

Declaration
Task<Role> GetRole(string roleId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String roleId

The id of the role.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Role>

The Role

GetSnapshotForContentType(String, String, String, CancellationToken)

Gets a single snapshot for a ContentType

Declaration
Task<SnapshotContentType> GetSnapshotForContentType(string snapshotId, string contentTypeId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String snapshotId

The id of the snapshot to get.

System.String contentTypeId

The id of content type the snapshot belongs to.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<SnapshotContentType>

The SnapshotContentType.

GetSnapshotForEntry(String, String, String, CancellationToken)

Gets a single snapshot for an Entry<T>

Declaration
Task<Snapshot> GetSnapshotForEntry(string snapshotId, string entryId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String snapshotId

The id of the snapshot to get.

System.String entryId

The id of entry the snapshot belongs to.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Snapshot>

The Snapshot.

GetSpace(String, CancellationToken)

Gets a space in Contentful.

Declaration
Task<Space> GetSpace(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the space to get.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Space>

The Space

GetSpaceMembership(String, String, CancellationToken)

Gets a single SpaceMembership for a space.

Declaration
Task<SpaceMembership> GetSpaceMembership(string spaceMembershipId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceMembershipId

The id of the space membership to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<SpaceMembership>

The SpaceMembership.

GetSpaceMemberships(String, CancellationToken)

Gets a collection of SpaceMembership for the user.

Declaration
Task<ContentfulCollection<SpaceMembership>> GetSpaceMemberships(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<SpaceMembership>>

A collection of SpaceMembership.

GetSpaces(CancellationToken)

Gets all spaces in Contentful.

Declaration
Task<IEnumerable<Space>> GetSpaces(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Space>>

An System.Collections.Generic.IEnumerable<T> of Space.

GetUpload(String, String, CancellationToken)

Gets an upload SystemProperties by the specified id.

Declaration
Task<UploadReference> GetUpload(string uploadId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String uploadId

The id of the uploaded file.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<UploadReference>

A SystemProperties with metadata of the upload.

GetUsagePeriods(String, CancellationToken)

Gets a collection of all UsagePeriod for an organization.

Declaration
Task<ContentfulCollection<UsagePeriod>> GetUsagePeriods(string organizationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String organizationId

The id of the organization to get usage periods for.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<UsagePeriod>>

A ContentfulCollection<T> of UsagePeriod.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

GetUser(String, String, CancellationToken)

Gets a single User for a space.

Declaration
Task<User> GetUser(string userId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String userId

The id of the user to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<User>

The User.

Exceptions
Type Condition
System.ArgumentException

The spaceMembershipId parameter was null or empty.

ContentfulException

There was an error when communicating with the Contentful API.

GetWebhook(String, String, CancellationToken)

Gets a single webhook from a Space.

Declaration
Task<Webhook> GetWebhook(string webhookId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String webhookId

The id of the webhook to get.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Webhook>

The Webhook.

GetWebhookCallDetails(String, String, String, CancellationToken)

Gets the details of a specific webhook call.

Declaration
Task<WebhookCallDetails> GetWebhookCallDetails(string callId, string webhookId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String callId

The id of the call to get details for.

System.String webhookId

The id of the webhook to get details for.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<WebhookCallDetails>

The WebhookCallDetails.

GetWebhookCallDetailsCollection(String, String, CancellationToken)

Gets all recent call details for a webhook.

Declaration
Task<ContentfulCollection<WebhookCallDetails>> GetWebhookCallDetailsCollection(string webhookId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String webhookId

The id of the webhook to get details for.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<WebhookCallDetails>>

A ContentfulCollection<T> of WebhookCallDetails.

GetWebhookHealth(String, String, CancellationToken)

Gets a response containing an overview of the recent webhook calls.

Declaration
Task<WebhookHealthResponse> GetWebhookHealth(string webhookId, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String webhookId

The id of the webhook to get health details for.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<WebhookHealthResponse>

A WebhookHealthResponse.

GetWebhooksCollection(String, CancellationToken)

Gets all webhooks for a Space.

Declaration
Task<ContentfulCollection<Webhook>> GetWebhooksCollection(string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ContentfulCollection<Webhook>>

A ContentfulCollection<T> of Webhook.

ProcessAsset(String, Int32, String, String, CancellationToken)

Processes an asset by the specified id.

Declaration
Task ProcessAsset(string assetId, int version, string locale, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to process.

System.Int32 version

The last known version of the asset.

System.String locale

The locale for which files should be processed.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task

ProcessAssetUntilCompleted(String, Int32, String, Int32, String, CancellationToken)

Processes an asset by the specified id and keeps polling the API until it has finished processing. Note that this might result in multiple API calls.

Declaration
Task<ManagementAsset> ProcessAssetUntilCompleted(string assetId, int version, string locale, int maxDelay = 2000, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to process.

System.Int32 version

The last known version of the asset.

System.String locale

The locale for which files should be processed.

System.Int32 maxDelay

The maximum number of milliseconds allowed for the operation.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset that has been processed.

Exceptions
Type Condition
System.ArgumentException

The assetId parameter was null or empty.

ContentfulException

There was an error when communicating with the Contentful API.

System.TimeoutException

The processing of the asset did not finish within the allotted time.

PublishAsset(String, Int32, String, CancellationToken)

Publishes an asset by the specified id.

Declaration
Task<ManagementAsset> PublishAsset(string assetId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to publish.

System.Int32 version

The last known version of the asset.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset published.

PublishEntry(String, Int32, String, CancellationToken)

Publishes an entry by the specified id.

Declaration
Task<Entry<dynamic>> PublishEntry(string entryId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.Int32 version

The last known version of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The response from the API serialized into Entry<T>

RevokeManagementToken(String, CancellationToken)

Revokes a single ManagementToken for a user.

Declaration
Task<ManagementToken> RevokeManagementToken(string managementTokenId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String managementTokenId

The id of the management token to revoke.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementToken>

The revoked ManagementToken.

UnarchiveAsset(String, Int32, String, CancellationToken)

Unarchives an asset by the specified id.

Declaration
Task<ManagementAsset> UnarchiveAsset(string assetId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to unarchive.

System.Int32 version

The last known version of the asset.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset unarchived.

UnarchiveEntry(String, Int32, String, CancellationToken)

Unarchives an entry by the specified id.

Declaration
Task<Entry<dynamic>> UnarchiveEntry(string entryId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.Int32 version

The last known version of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The response from the API serialized into Entry<T>

UnpublishAsset(String, Int32, String, CancellationToken)

Unpublishes an asset by the specified id.

Declaration
Task<ManagementAsset> UnpublishAsset(string assetId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String assetId

The id of the asset to unpublish.

System.Int32 version

The last known version of the asset.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The ManagementAsset unpublished.

UnpublishEntry(String, Int32, String, CancellationToken)

Unpublishes an entry by the specified id.

Declaration
Task<Entry<dynamic>> UnpublishEntry(string entryId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String entryId

The id of the entry.

System.Int32 version

The last known version of the entry.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The response from the API serialized into Entry<T>

UpdateApiKey(String, String, String, Int32, String, CancellationToken)

Updates an ApiKey in a space.

Declaration
Task<ApiKey> UpdateApiKey(string id, string name, string description, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the API key to update.

System.String name

The name of the API key to update.

System.String description

The description of the API key to update.

System.Int32 version

The last known version of the api key.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ApiKey>

The updated ApiKey.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

UpdateEditorInterface(EditorInterface, String, Int32, String, CancellationToken)

Updates a EditorInterface for a specific ContentType.

Declaration
Task<EditorInterface> UpdateEditorInterface(EditorInterface editorInterface, string contentTypeId, int version, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
EditorInterface editorInterface

The editor interface to update.

System.String contentTypeId

The id of the content type.

System.Int32 version

The last known version of the content type.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<EditorInterface>

The response from the API serialized into a EditorInterface.

UpdateEntryForLocale(Object, String, String, String, CancellationToken)

Updates an entry fields for a certain locale using the values from the provided object.

Declaration
Task<Entry<dynamic>> UpdateEntryForLocale(object entry, string id, string locale = null, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Object entry

The object to use as values for the entry fields.

System.String id

The id of the entry to update.

System.String locale

The locale to set the fields for. The default locale for the space will be used if this parameter is null.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Entry<System.Object>>

The created or updated Entry<T>.

UpdateLocale(Locale, String, CancellationToken)

Updates a locale in the specified Space.

Declaration
Task<Locale> UpdateLocale(Locale locale, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Locale locale

The Locale to update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Locale>

The created Locale.

UpdateOrganizationMembership(String, String, String, CancellationToken)

Updates a OrganizationMembership for a space.

Declaration
Task<OrganizationMembership> UpdateOrganizationMembership(string role, string membershipId, string organizationId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String role

The role to set for the membership.

System.String membershipId

The id of the membership to update.

System.String organizationId

The id of the organization.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<OrganizationMembership>

The OrganizationMembership.

Exceptions
Type Condition
ContentfulException

There was an error when communicating with the Contentful API.

UpdateRole(Role, String, CancellationToken)

Updates a role in a Space.

Declaration
Task<Role> UpdateRole(Role role, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Role role

The role to update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Role>

The updated Role.

UpdateSpaceMembership(SpaceMembership, String, CancellationToken)

Updates a SpaceMembership for a space.

Declaration
Task<SpaceMembership> UpdateSpaceMembership(SpaceMembership spaceMembership, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
SpaceMembership spaceMembership

The membership to update.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<SpaceMembership>

The SpaceMembership.

UpdateSpaceName(Space, String, CancellationToken)

Updates the name of a space in Contentful.

Declaration
Task<Space> UpdateSpaceName(Space space, string organisation = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
Space space

The space to update, needs to contain at minimum name, Id and version.

System.String organisation

The organisation to update a space for. Not required if the account belongs to only one organisation.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Space>

The updated Space

UpdateSpaceName(String, String, Int32, String, CancellationToken)

Updates a space in Contentful.

Declaration
Task<Space> UpdateSpaceName(string id, string name, int version, string organisation = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String id

The id of the space to update.

System.String name

The name to update to.

System.Int32 version

The version of the space that will be updated.

System.String organisation

The organisation to update a space for. Not required if the account belongs to only one organisation.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<Space>

The updated Space

UploadFile(Byte[], String, CancellationToken)

Uploads the specified bytes to Contentful.

Declaration
Task<UploadReference> UploadFile(byte[] bytes, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Byte[] bytes

The bytes to upload.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<UploadReference>

A SystemProperties with an id of the created upload.

UploadFileAndCreateAsset(ManagementAsset, Byte[], String, CancellationToken)

Uploads an array of bytes and creates an asset in Contentful as well as processing that asset.

Declaration
Task<ManagementAsset> UploadFileAndCreateAsset(ManagementAsset asset, byte[] bytes, string spaceId = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
ManagementAsset asset

The asset to create

System.Byte[] bytes

The bytes to upload.

System.String spaceId

The id of the space. Will default to the one set when creating the client.

System.Threading.CancellationToken cancellationToken

The optional cancellation token to cancel the operation.

Returns
Type Description
System.Threading.Tasks.Task<ManagementAsset>

The created ManagementAsset.

Back to top Copyright © 2015-2016 Contentful
Generated by DocFX