ApiNgJsonRpcOperations problem setting matchProject Get a Json error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garygman
    Junior Member
    • Sep 2015
    • 1

    #1

    ApiNgJsonRpcOperations problem setting matchProject Get a Json error

    Hi, I am using coded provided, but when I set market projection I get the follow error. any ideas how I can fix ths?

    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 99

    I am calling this code
    public List<MarketCatalogue> listMarketCatalogue(MarketFilter filter, Set<MarketProjection> marketProjection,
    MarketSort sort, String maxResult, String appKey, String ssoId) throws APINGException {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put(LOCALE, locale);
    params.put(FILTER, filter);
    params.put(SORT, sort);
    params.put(MAX_RESULT, maxResult);

    params.put(MARKET_PROJECTION, marketProjection);
    String result = getInstance().makeRequest(ApiNgOperation.LISTMARKE TCATALOGUE.getOperationName(), params, appKey, ssoId);

    here is the debug respose, it fails when parsing


    Request: {"jsonrpc":"2.0","method":"SportsAPING/v1.0/listMarketCatalogue","id":"1","params":{"filter":{ "textQuery":"MATCH_ODDS","eventIds":["27538776"]},"maxResults":"1","sort":"FIRST_TO_START","locale ":"en_GB","marketProjection":["COMPETITION","MARKET_START_TIME"]}}

    Response: {"jsonrpc":"2.0","result":[{"marketId":"1.120646450","marketName":"Match Odds","marketStartTime":"2015-09-28T19:00:00.000Z","totalMatched":111198.5,"competi tion":{"id":"31","name":"Barclays Premier League"}}],"id":"1"}
Working...
X