I was trying out the web api as an option to use as a way to integrate some of our store data into a mobile app that we are working on. But I am having a problem when testing the calls that require a parameter.
What I am doing is accessing the api via /api/help then using the test button on that page.
When a test the api is called with api that does not require a parameter the call returns data as expected. But when I try to make a call with a parameter it does not work. The status get returned at 404/Not Found.
For example if i use api/Products/List it does return a list of the products. But when a tried api/Product/{id} or any other product api's that takes an id it does not work.
I checked the documentation also but did not see anything that helped. Want am I missing to get this to work.
Eldon
Web API problem
Re: Web API problem
You need to use api/Products/{id}. Products/list will return all products while products/{id} will return just one with matching id.
Re: Web API problem
Sorry for not being clear... But api/Products/{id} was one that I tried.
I seems lit anything I try that requires a parameter does not work, but all of the ones I try that do not require a parameter do work.
Here is capture of what it returns
I seems lit anything I try that requires a parameter does not work, but all of the ones I try that do not require a parameter do work.
Here is capture of what it returns
Re: Web API problem
After spending some more time on with the api it appears that the issues are only happening for the Products api.
None of the api calls work via the test page but I noticed they are returning "HTTPS required" in the body portion of the test page.
So when i tried the api for the other areas (user, Categories, etc) and made the call outside of the test page they are returning data as expected.
BUT the I still can not get the api/Products/{id} to work even if i use https - that returns a "page can’t be found" erron the page.
Oddly enough if I try to get the product via the Admin API (i.e api/AdminProducts/{id}) it DOES return the product data.
Also I noticed on the test page for the Products api that none of the sample data is displayed. Here is what displayed
None of the api calls work via the test page but I noticed they are returning "HTTPS required" in the body portion of the test page.
So when i tried the api for the other areas (user, Categories, etc) and made the call outside of the test page they are returning data as expected.
BUT the I still can not get the api/Products/{id} to work even if i use https - that returns a "page can’t be found" erron the page.
Oddly enough if I try to get the product via the Admin API (i.e api/AdminProducts/{id}) it DOES return the product data.
Also I noticed on the test page for the Products api that none of the sample data is displayed. Here is what displayed