Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src/main/java/au/com/nec/id/client
LICENSE.txt
NOTICE.txt
README.md
build.gradle
pom.xml

README.md

Prerequisites

In order to compile the generated client, you need:

  • Install Apache Maven. Tested with version 3.x.
  • Install JDK. Recommended with JDK 1.7+.

Compile

Make sure JAVA_HOME is set, then run

mvn install

This will install the generated client to your local Maven repository.

Use it in your project

Copy NECID-1.1.jar from the target folder and all other libraries located in target/lib to your project's lib folder.

You can initialize the SDK using the ApiClientFactory object.

ApiClientFactory factory = new ApiClientFactory();
// create a client
final BiometricAPIClient client = factory.build(BiometricAPIClient.class);

// Invoke your faceExtractPost method
ExtractResult  output = client.faceExtractPost();

// you also have access to your API models
Candidate myModel = new Candidate();
myModel.setId(id);
myModel.setScore(score);
myModel.setEvents(events);

Using AWS IAM for authorization

To use AWS IAM to authorize API calls you pass set of AWS credentials to the SDK through the ApiClientFactory.

// Use CognitoCachingCredentialsProvider to provide AWS credentials
// for the ApiClientFactory
AWSCredentialsProvider credenetialsProvider = new CognitoCachingCredentialsProvider(
        context,          // activity context
        "identityPoolId", // Cognito identity pool id
        Regions.US_EAST_1 // region of Cognito identity pool
);
ApiClientFactory factory = new ApiClientFactory()
        .credentialsProvider(credentialsProvider);

Using API Keys

You can also use the ApiClientFactory to set the API Key in the generated client SDK.

ApiClientFactory factory = new ApiClientFactory()
        .apiKey("YOUR_API_KEY");
You can’t perform that action at this time.