Date filtering does not work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sasi
    Junior Member
    • Jan 2021
    • 3

    #1

    Date filtering does not work

    A working post without date filtering:
    {"jsonrpc":"2.0","method":"SportsAPING/v1.0/listMarketCatalogue","id":"1","params":{"filter":{ "eventTypeIds":["2"],"marketTypeCodes":["MATCH_ODDS"]},"maxResults":1000}}

    The same post with just the date filter added, does not work:
    {"jsonrpc":"2.0","method":"SportsAPING/v1.0/listMarketCatalogue","id":"1","params":{"filter":{ "eventTypeIds":["2"],"marketTypeCodes":["MATCH_ODDS"],"marketStartTime":{"from":"Jun 25, 2021","to":"Jun 29, 2021"}},"maxResults":1000}}

    Reponse: {"jsonrpc":"2.0","error":{"code":-32602,"message":"DSC-0018"},"id":"1"}

    The API reference says: DSC-0018 MandatoryNotDefined - A parameter marked as mandatory was not provided

    Though I have no idea which parameter is missing, my TimeRange class has the same fields as described in the API reference guide. If I paste the text into a JSON validator it shows no problem. Any help would be appreciated.

    Peter

    Edit:

    After some searching in the forum, I've managed to find out the solution. I was missing to include the hour min secs in the data. For example: marketStartTime":{"from":"2021-06-26T14:28:44.127Z","to":"2021-06-29T17:28:44.131Z"}

    Now it's working as expected.
    Last edited by sasi; 26-06-2021, 04:33 PM.
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    The marketStartTime is stored as a timestamp. There are examples of calls using the appropriate time format in the Getting Started section of the documentation.

    Comment

    • sasi
      Junior Member
      • Jan 2021
      • 3

      #3
      Thank you for replying, it seems it also works with date-time, not with date only though.

      Comment

      Working...
      X