Skip to content

iarroyo/latch-sdk-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LATCH JAVA SDK

#### PREREQUISITES ####

USING THE SDK IN JAVA

  • Include all SDK files and dependencies in your project.

  • Create a new class (for example LatchSDK.java) extending Latch.java. This class should override HTTP_GET method with your own implementation to perform HTTP requests as you usually perform them in your project.

     public class LatchSDK extends Latch{

          @Override
          public JsonElement HTTP_GET(String URL, Map<String, String>headers) {
               //Your implementation here
          }
     }
  • Create a Latch object with the "Application ID" and "Secret" previously obtained.
     LatchSDK latch = new LatchSDK(APP_ID, SECRET);
  • Call to Latch Server. Pairing will return an account id that you should store for future api calls
     LatchResponse pairResponse = latch.pair(TOKEN);
     LatchResponse statusResponse = latch.status(ACCOUNT_ID);
     LatchResponse opStatusResponse = latch.operationStatus(ACCOUNT_ID, OPERATION_ID);
     LatchResponse unpairResponse = latch.unpair(ACCOUNT_ID);
  • After every API call, get Latch response data and errors and handle them.
     JsonObject jObject = latchResponse.getData();
     com.elevenpaths.latch.Error error = latchResponse.getError();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%