Skip to content

Commit 7f11d9f

Browse files
author
Dasmeet Doowa
committed
2 parents 40189d1 + 7aea688 commit 7f11d9f

7 files changed

Lines changed: 18 additions & 21 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Betfair API-NG Code Samples
1+
Betfair API-NG Code Samples
2+
===============================
23

3-
This github respository contains sample code in various languages to help customers get started with writing betfair API-NG clients.
4+
This github respository contains sample code in various languages to help customers get started with writing betfair API-NG clients. For more information about API-NG please see [Getting started with API-NG documentation](https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Getting+Started+with+API-NG) and [developer.betfair.com](http://developer.betfair.com).
5+
6+
Please note, these are not intended to be fully fledged clients and all follow an identical set of scenarios. As a result, we do not wish to extend the samples with pull requests that extend only a single language sample or add functionality not in the below scenarios.
47

58
Each of the basic language samples demonstrates a basic use case of placing a bet on the next GB Horse Racing market:
69

@@ -11,7 +14,7 @@ Each of the basic language samples demonstrates a basic use case of placing a be
1114

1215
For the sake of simplictity and ease of understanding, these samples are not intended to show best practice for optimisations for speed or throughput.
1316

14-
A comprehensive description of the samples can be found <a href="http://my.developer.betfair.com/">here.</a>
17+
A comprehensive description of the samples can be found in the [developer samples documentation](https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Sample+Code).
1518

1619
There is also a limited sample of login examples within the loginCode subdirectory and an Android sample app in the android subdirectory.
1720

java/ng/src/main/java/com/betfair/aping/ApiNGJRescriptDemo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void start(String appKey, String ssoid) {
9090
PriceProjection priceProjection = new PriceProjection();
9191
Set<PriceData> priceData = new HashSet<PriceData>();
9292
priceData.add(PriceData.EX_BEST_OFFERS);
93+
priceProjection.setPriceData(priceData);
9394

9495
//In this case we don't need these objects so they are declared null
9596
OrderProjection orderProjection = null;

java/ng/src/main/java/com/betfair/aping/ApiNGJsonRpcDemo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void start(String appKey, String ssoid) {
9090
PriceProjection priceProjection = new PriceProjection();
9191
Set<PriceData> priceData = new HashSet<PriceData>();
9292
priceData.add(PriceData.EX_BEST_OFFERS);
93+
priceProjection.setPriceData(priceData);
9394

9495
//In this case we don't need these objects so they are declared null
9596
OrderProjection orderProjection = null;

java/ng/src/main/java/com/betfair/aping/api/ApiNgJsonRpcOperations.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public List<MarketBook> listMarketBook(List<String> marketIds, PriceProjection p
5151
Map<String, Object> params = new HashMap<String, Object>();
5252
params.put(LOCALE, locale);
5353
params.put(MARKET_IDS, marketIds);
54+
params.put(PRICE_PROJECTION, priceProjection);
55+
params.put(ORDER_PROJECTION, orderProjection);
56+
params.put(MATCH_PROJECTION, matchProjection);
5457
String result = getInstance().makeRequest(ApiNgOperation.LISTMARKETBOOK.getOperationName(), params, appKey, ssoId);
5558
if(ApiNGDemo.isDebug())
5659
System.out.println("\nResponse: "+result);

java/ng/src/main/java/com/betfair/aping/api/ApiNgOperations.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public abstract class ApiNgOperations {
2929
protected final String INSTRUCTIONS = "instructions";
3030
protected final String CUSTOMER_REF = "customerRef";
3131
protected final String MARKET_PROJECTION = "marketProjection";
32+
protected final String PRICE_PROJECTION = "priceProjection";
33+
protected final String MATCH_PROJECTION = "matchProjection";
34+
protected final String ORDER_PROJECTION = "orderProjection";
3235
protected final String locale = Locale.getDefault().toString();
3336

3437
public abstract List<EventTypeResult> listEventTypes(MarketFilter filter, String appKey, String ssoId) throws APINGException;

java/ng/src/main/java/com/betfair/aping/api/ApiNgRescriptOperations.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public List<MarketBook> listMarketBook(List<String> marketIds, PriceProjection p
4545
Map<String, Object> params = new HashMap<String, Object>();
4646
params.put(LOCALE, locale);
4747
params.put(MARKET_IDS, marketIds);
48+
params.put(PRICE_PROJECTION, priceProjection);
49+
params.put(ORDER_PROJECTION, orderProjection);
50+
params.put(MATCH_PROJECTION, matchProjection);
4851
String result = getInstance().makeRequest(ApiNgOperation.LISTMARKETBOOK.getOperationName(), params, appKey, ssoId);
4952
if(ApiNGDemo.isDebug())
5053
System.out.println("\nResponse: "+result);
@@ -62,6 +65,7 @@ public List<MarketCatalogue> listMarketCatalogue(MarketFilter filter, Set<Market
6265
params.put(FILTER, filter);
6366
params.put(SORT, sort);
6467
params.put(MAX_RESULT, maxResult);
68+
params.put(MARKET_PROJECTION, marketProjection);
6569
String result = getInstance().makeRequest(ApiNgOperation.LISTMARKETCATALOGUE.getOperationName(), params, appKey, ssoId);
6670
if(ApiNGDemo.isDebug())
6771
System.out.println("\nResponse: "+result);

java/ng/src/main/java/com/betfair/aping/containers/CompetitionResultContainer.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)