ConstructorIO.ConstructorIOAPI.RemoveBatchAsync C# (CSharp) Method

RemoveBatchAsync() public method

Removed multiple items from your autocomplete.
public RemoveBatchAsync ( IEnumerable ItemsToRemove, string AutocompleteSection ) : Task
ItemsToRemove IEnumerable The items to remove.
AutocompleteSection string The autocomplete section to remove from.
return Task
        public async Task<bool> RemoveBatchAsync(IEnumerable<ListItem> ItemsToRemove, string AutocompleteSection)
        {
            var removeBatchRequest = new ConstructorIORequest(APIRequestType.V1_BatchItems, "DELETE");

            removeBatchRequest.RequestBody["items"] = ItemsToRemove.ToArray().Select(item => item.GetAsRemoveHash());
            removeBatchRequest.RequestBody["autocomplete_section"] = AutocompleteSection;

            var removeBatchResponse = await Requestor.MakeRequest(removeBatchRequest);
            return removeBatchResponse.Item1;
        }