LinnSystems / LinnworksNetSDK

Linnworks.net Developers
26 stars 41 forks source link

404 - GetAllOpenOrders #3

Closed jmawebtech closed 8 years ago

jmawebtech commented 8 years ago

Hi,

I am trying to pull a list of orders by date. I called the AuthorizeByApplication method and received a token with server. I have added the token and server to my request. I have some questions:

  1. I am getting a 404 error code. Am I using the wrong URL?
  2. Is my JSON correct?
  3. Does the 404 mean there are no orders? I just created an order by hand in Linnworks for testing. Am I using the correct method to query newly created orders in Linnworks?

Here is my request:

POST https://us1.linnworks.net/Orders/GetAllOpenOrders HTTP/1.1 Accept: application/json Content-Type: application/x-www-form-urlencoded Authorization: XX Host: us1.linnworks.net Content-Length: 258 Expect: 100-continue Connection: Keep-Alive

entriesPerPage=1&pageNumber=1&filters={"TextFields":null,"BooleanFields":null,"NumericFields":null,"DateFields":[{"DateFrom":"2016-02-03T10:35:05.942697-05:00","DateTo":"2016-02-08T10:35:05.9477296-05:00","Type":0,"Value":0,"FieldCode":1}],"ListFields":null}

Response

HTTP/1.1 404 Not Found

LinnSystems commented 8 years ago

Hi @jmawebtech,

The URL structuring should be as follows:

https://us1.linnworks.net/api/Orders/GetAllOpenOrders

So:

https://[SERVER]/api/[CONTROLLER]/[METHOD]

I believe you're missing the api folder from above.

jmawebtech commented 8 years ago

Hi,

OK, that removed the 404 error. I now get an error saying my request is invalid. Are my parameters correct?

LinnSystems commented 8 years ago

Hi @jmawebtech,

You're missing 3 parameters from this call. Check the following URL:

http://apps.linnworks.net/Api/Method/GetOpenOrders

If you have any questions in regards to calls, it's best to check the API Documentation and confirm that you have all the correct parameters there. If you still have issues, you can go through the Linnworks Support system.