Data services extensions and parameters

Data service extensions

Use the Context.setIncludeParam() method to request reserved name/value pairs to be included in the response, as supported by the given resource. This is analogous to using query parameters for reserved name/value pairs in REST API requests.

The example below shows how to specify the firsttxndate query parameter, as supported by the CompanyInfo resource for first transaction date, to be included in the response code:

1
context = new Context(oauth, appToken, ServiceType.QBO, realmId); List<String> includeQueryParam = new ArrayList<String>(); includeQueryParam.add("firsttxndate"); context.setIncludeParam(includeQueryParam);

For more details on this an all other reserved query parameters supported by the CompanyInfo resource, see CompanyInfo.

The following code shows how to specify the allowduplicatedocnum query parameter, as supported by the Purchase resource, to allow duplicate check numbers to be included in the response code:

1
context = new Context(oauth, appToken, ServiceType.QBO, realmId); List<String> includeQueryParam = new ArrayList<String>(); includeQueryParam.add("allowduplicatedocnum"); context.setIncludeParam(includeQueryParam);

For details on the allowduplicatedocnum query parameter, see Purchase.

Specifying minor versions

Use the Context.setMinorVersion() method to access features for a given minor version. This is analogous to using the minorVersion query parameter in REST API requests. The following is an example showing how to specify minor version 8:

1
context = new Context(oauth, appToken, ServiceType.QBO, realmId); context.setMinorVersion("8");

For details on minor versions, see Minor versions. The SDK defaults to the most current minor version listed on that page.