Web API problem

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Web API problem

Post by egormsen » Sun Jan 01, 2017 3:36 pm

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
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Web API problem

Post by mazhar » Mon Jan 02, 2017 3:02 am

You need to use api/Products/{id}. Products/list will return all products while products/{id} will return just one with matching id.

egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Re: Web API problem

Post by egormsen » Mon Jan 02, 2017 5:31 am

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
ApiError.png
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Re: Web API problem

Post by egormsen » Mon Jan 02, 2017 8:43 am

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
ApiError2.png
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

Post Reply