Java 1.8 or later
Add this dependency to your project's POM:
<dependency><groupId>com.quicko</groupId><artifactId>api-client</artifactId><version>3.4.0-BUILD-RELEASE</version></dependency>
You'll need to manually install the following JARs:
The Quicko API Client JAR from https://github.com/TeamQuicko/quicko-api-client/releases/latest
Instantiate ApiClient
with api_key
& api_secret
. Use this ApiClient to call Paid APIs or to access resources on server for api user. You can obtain the key from the dashboard. https://dashboard.api.quicko.com/
// Initialize ApiUserCredentialsApiUserCredentials credentials = new ApiUserCredentials("api_key", "api_secret");// Initialize ApiClient with API sessionApiClient client =ApiClientBuilder.basic().withCredentials(credentials).build();// Use ApiClient to call Paid APIs or to access resources on server for api userGoodsAndServicesTaxIdentificationNumber gstin = client.GST.GSP.PUBLIC.searchGSTIN(gstin);
You can initialize ApiClient
with Resource Owner session using OAuth. Use this ApiClient
to access resources on server on behalf of resource owner.
Steps:
Navigate to the Quicko OAuth login page with the api_key
A successful login comes back with a request_token to the registered redirect URL
Provide the request_token using OAUTH.authorize
Obtain the access_token and use that to build a ApiClient
with resource owner session
// Initialize ApiClient for API UserApiClient client =ApiClientBuilder.basic().withCredentials(new ApiUserCredentials("api_key", "api_secret")).build();// When using Redirection based OAuth workflow, a successful login comes back with a request token// to the registered redirect URL. Use that request token to obtain resource owner access token.String accessToken = client.OAUTH.authorize(requestToken);// Initialize ApiClient with OAuth sessionApiClient resourceOwnerClient =ApiClientBuilder.basic().withCredentials(new ApiUserCredentials("api_key", "api_secret")).build(accessToken);// Use ApiClient to call APIs to access resources on server on behalf of resource ownerList<TaxPayer> taxpayers = resourceOwnerClient.IT.TAXPAYER.getTaxPayers(pan);
Steps:
Generate OTP for user using OAUTH.generateOTP
User will obtain an One Time Password (OTP) on their registered email address with validity of 10 mins
Provide the otp and username (user's email) to verify otp using OAUTH.authenticate
Obtain the access_token and use that to build a ApiClient
with resource owner session
// Initialize ApiClient for API UserApiClient client =ApiClientBuilder.basic().withCredentials(new ApiUserCredentials("api_key", "api_secret")).build();// When using API based OAuth workflow, generate OTP for resource owner.client.OAUTH.generateOTP(username);// Verify OTP for resource owner authentication.String accessToken = client.OAUTH.authenticate(username, otp);// Initialize ApiClient with OAuth sessionApiClient resourceOwnerClient =ApiClientBuilder.basic().withCredentials(new ApiUserCredentials("api_key", "api_secret")).build(accessToken);// Use ApiClient to call APIs to access resources on server on behalf of resource ownerList<TaxPayer> taxpayers = resourceOwnerClient.IT.TAXPAYER.getTaxPayers(pan);