Posted on 10/09/2020 13:29:16
Hi
I am trying to use the Ecommerce web API. But I can't get it to work. If for example I request this url:
/dwapi/Products/GetProductList?ProductIds=PROD213,PROD214&LanguageId=LANG1&CurrencyCode=DKK&FilledProperties=Id,VariantId,Name
I get this error message:
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>Some property names do not match the viewmodel ('Dynamicweb.Ecommerce.ProductCatalog.ProductListViewModel'): Invalid input=[Id, VariantId, Name], Valid property names=[Group, SubGroups, Products, PageSize, PageCount, CurrentPage, TotalProductsCount, SpellCheckerSuggestions, FacetGroups].</ExceptionMessage>
<ExceptionType>System.ArgumentException</ExceptionType>
<StackTrace> at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBase`1.CheckInvalidNames() at Dynamicweb.Ecommerce.ProductCatalog.ViewSettingsBase`1.EnsureFilledPropertiesExist() at Dynamicweb.Ecommerce.ProductCatalog.ProductListViewModelSettings.EnsureFilledPropertiesExist() at Dynamicweb.Ecommerce.WebAPI.Controllers.ProductController.GetProductList(String[] productIds, ProductListViewModelSettings settings) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace>
</Error>
If I request this url:
/dwapi/Products/GetProductGroupList/GROUP5?LanguageId=LANG1&CurrencyCode=DKK&FilledProperties=Id,VariantId,LanguageId,Name,ShortDescription,Number
I get this error message:
<Error>
<Message>No HTTP resource was found that matches the request URI 'http://[mysitename]/dwapi/Products/GetProductGroupList/GROUP5?LanguageId=LANG1&CurrencyCode=DKK&FilledProperties=Id,VariantId,LanguageId,Name,ShortDescription,Number'.</Message>
<MessageDetail>No action was found on the controller 'Product' that matches the request.</MessageDetail>
</Error>
Runnig DW v9.8.8