{"id":21744015,"url":"https://github.com/telefonica/latch-sdk-java","last_synced_at":"2025-04-13T05:07:21.086Z","repository":{"id":12430687,"uuid":"15086702","full_name":"Telefonica/latch-sdk-java","owner":"Telefonica","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-27T07:42:44.000Z","size":1777,"stargazers_count":6,"open_issues_count":1,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-13T05:07:13.832Z","etag":null,"topics":["dir-cto","org-cdo","public","srv-latch","srv-livingapps"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Telefonica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-10T19:13:58.000Z","updated_at":"2025-02-20T12:14:02.000Z","dependencies_parsed_at":"2025-02-20T13:23:43.709Z","dependency_job_id":"d81a1057-9898-42f0-a382-0e2fe1ba8379","html_url":"https://github.com/Telefonica/latch-sdk-java","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Telefonica","download_url":"https://codeload.github.com/Telefonica/latch-sdk-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665747,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dir-cto","org-cdo","public","srv-latch","srv-livingapps"],"created_at":"2024-11-26T07:09:45.079Z","updated_at":"2025-04-13T05:07:21.080Z","avatar_url":"https://github.com/Telefonica.png","language":"Java","readme":"### LATCH JAVA SDK ###\n\n\n#### PREREQUISITES ####\n\n* Java 1.5 or above.\n\n* Read API documentation (https://latch.tu.com/www/developers/doc_api).\n\n* To get the \"Application ID\" and \"Secret\", (fundamental values for integrating Latch in any application), it’s necessary to register a developer account in Latch's website: https://latch.tu.com. On the upper right side, click on \"Developer area\".\n\n\n#### CREATING THE JAR DEPENDENCY ####\n\nNow using Maven (maven.apache.org) is easy to compile and pack all the code for using externally:\n\n\u003e mvn install\n\nAnd the compiled jar was located in the `target` directory.\n\nYou can also compile the jar with all Latch dependencies included:\n\n\u003e mvn clean compile assembly:single\n=======\n\n\n#### USING THE SDK IN JAVA ####\n\n* Include all SDK files and dependencies in your project.\n\n* Create a Latch object with the \"Application ID\" and \"Secret\" previously obtained.\n```\n     Latch latch = new Latch(APP_ID, SECRET);\n```\n\n* Call to Latch Server. Pairing will return an account id that you should store for future api calls\n```\n     LatchResponse pairResponse = latch.pair(TOKEN);\n     LatchResponse statusResponse = latch.status(ACCOUNT_ID);\n     LatchResponse opStatusResponse = latch.operationStatus(ACCOUNT_ID, OPERATION_ID);\n     LatchResponse unpairResponse = latch.unpair(ACCOUNT_ID);\n```\n\n* After every API call, get Latch response data and errors and handle them.\n```\n     JsonObject jObject = latchResponse.getData();\n     com.elevenpaths.latch.Error error = latchResponse.getError();\n```\n\n#### USING JAVA SDK FOR WEB3 SERVICES ####\n\nFor using the Java SDK within an Web3 service, you must complain with the following:\n\n* In the Latch website, having an developer account, with the Web3 permissions activated. You must see a new button for creating a Web3 new app.\n\n* [Tutorial to follow for creating a new WEB3 app](doc/Latch_WEB3_Apps.pdf)\n\n* You need a wallet to operate on Polygon blockchain. You can easily create one through [Metamask](https://metamask.io/download/).\n\nYou need this additional parameters:\n- WEB3WALLET: The Ethereum-based address wallet for the user that wants to pair the service.\n- WEB3SIGNATURE: A proof-of-ownership signature of a constant, in order to verify that the user owns the private key of the wallet. You can use https://etherscan.io/verifiedSignatures# to sign the following message:\n- MESSAGE TO SIGN : **\"Latch-Web3\"**\n\nExample of using it [java example](src/test/java/ExampleWeb3.java)\n\n\n#### TROUBLESHOOTING ####\n\n*A javax.net.ssl.SSLHandshakeException with a nested sun.security.validator.ValidatorException is thrown when invoking an API call.*\n\nThis exception is normally thrown when the JDK doesn't trust the CA that signs the digital certificate used in Latch's website (https://latch.tu.com). You may need to install the CA (http://www.startssl.com/certs/ca.pem) as a trusted certificate in your JDK's truststore (normally in jre/lib/security/cacerts) using the keytool utility.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flatch-sdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelefonica%2Flatch-sdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flatch-sdk-java/lists"}