Work with dynamic items
Get a dynamic item
You can get a single item using the GetItem
method of the IRestClient
interface.
The following code gets a press release item by its ID:
NOTE: You can optionally get a field of the item or get it from a particular provider or culture.
Get a collection of dynamic items
You can get a collection of items using the GetItems
method of the IRestClient
interface.
The following code gets all items of type press release:
NOTE: You can optionally get specific fields of the press release items or get them from a particular provider or culture. You can also skip or take specified number of items in the collection.
Get a collection of dynamic items in order
You can get a collection of items using the GetItems
method of the IRestClient
interface and then order the collection by the value of a field.
The following code gets all items of type press release and orders it ascending by the title:
Get a filtered collection of dynamic items
You can get a collection of items using the GetItems
method of the IRestClient
interface and then filter the collection by the value of one or more fields.
The following code gets all items of type press release and filters it based on its title containg two specified values:
Get the parent type of a dynamic item
You can get a collection of items using the GetParent
method of the IRestClient
interface.
The following code gets the parent type of a an item by providing the item's type:
Create a dynamic item
You create items using the CreateItem
method of the IRestClient
interface.
The following code creates a press release item with title Sample title and sets the value of its MyCustomFieldName
field to My custom field value
:
NOTE: You can optionally provide a provider name, which will create the item in a specified provider.
Create dynamic items relations
You create items using the RelateItem
method of the IRestClient
interface.
The following code adds specific related data item to a specified field of a dynamic item:
Update an item
You update items using the UpdateItem
method of the IRestClient
interface.
The following code updates the title of the press release with the specified ID to Sample title
and the value of its MyCustomFieldName
field to My custom field value
:
Delete an item
You delete items using the DeleteItem
method of the IRestClient
interface.
The following code deletes the press release with the specified ID: