{"id":19632980,"url":"https://github.com/sitewhere/sitewhere-java-api","last_synced_at":"2026-03-10T18:31:50.719Z","repository":{"id":54150463,"uuid":"159689108","full_name":"sitewhere/sitewhere-java-api","owner":"sitewhere","description":"Contains core data model and Java API for interacting with SiteWhere via REST","archived":false,"fork":false,"pushed_at":"2021-05-06T15:12:58.000Z","size":2625,"stargazers_count":7,"open_issues_count":3,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-28T07:40:11.510Z","etag":null,"topics":["java-api","sitewhere"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitewhere.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}},"created_at":"2018-11-29T15:40:26.000Z","updated_at":"2021-04-22T11:04:03.000Z","dependencies_parsed_at":"2022-08-13T07:40:37.128Z","dependency_job_id":null,"html_url":"https://github.com/sitewhere/sitewhere-java-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sitewhere/sitewhere-java-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitewhere%2Fsitewhere-java-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitewhere%2Fsitewhere-java-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitewhere%2Fsitewhere-java-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitewhere%2Fsitewhere-java-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitewhere","download_url":"https://codeload.github.com/sitewhere/sitewhere-java-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitewhere%2Fsitewhere-java-api/sbom","scorecard":{"id":828099,"data":{"date":"2025-08-11","repo":{"name":"github.com/sitewhere/sitewhere-java-api","commit":"e6545f48ad0359dc0ba86344587cbdf367bb6b12"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T17:01:53.570Z","repository_id":54150463,"created_at":"2025-08-23T17:01:53.570Z","updated_at":"2025-08-23T17:01:53.570Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30347397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["java-api","sitewhere"],"created_at":"2024-11-11T12:15:54.395Z","updated_at":"2026-03-10T18:31:50.664Z","avatar_url":"https://github.com/sitewhere.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.sitewhere/sitewhere-java-client.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.sitewhere%22%20AND%20a:%22sitewhere-java-client%22)\n\n# SiteWhere Java Model and REST API Library\n\nThis repository contains the core Java API and data model used to interact\nwith REST services on a SiteWhere instance.\n\n## Using the Java Client\n\nThe Java client wraps the Spring `RestTemplate` mechanism and takes care\nof acquiring a JWT from the SiteWhere instance and storing it for use in the REST\nAPI calls. A new client with the default settings may be created as follows:\n\n```java\nISiteWhereClient client = SiteWhereClient.newBuilder().build().initialize();\n```\n\nThe default settings are:\n\n| Attribute   | Value        |\n|:------------|:-------------|\n| Protocol    | HTTP         |\n| Hostname    | localhost    |\n| Port        | 80           |\n| Username    | admin        |\n| Password    | password     |\n\nNote that the `initialize()` method must be called before using the client. This sets\nup the template and connects to the server to acquire a JWT.\n\nTo change the default connection settings use:\n\n```java\nSiteWhereClient.newBuilder().withConnectionTo(\"https\", \"myhost\", 8081).build().initialize();\n```\n\nTo connect as a different user user:\n\n```java\nSiteWhereClient.newBuilder().forUser(\"myuser\", \"mypassword\").build().initialize();\n```\n\n## Interacting with the SiteWhere Model\nOnce the client has been initialized, methods on it may be invoked to interact with\nthe data model on the remote SiteWhere instance. There are two types of calls,\nglobal calls and tenant-specific calls.\n\n### Global Calls\nFor global calls, no extra information is required in order to make the invocation. \nFor instance, to get the instance version information, invoke:\n\n```java\nVersion version = client.getSiteWhereVersion();\n```\n\nThe object model for all of the core SiteWhere data model is included with the client.\n\n### Tenant Calls\nFor calls that are tenant-specific, more information must be passed along with each\nmethod invocation. You must provide the tenant id and tenant authentication token\nwhich are passed as headers to the REST call (along with the JWT used for all calls).\nThe format for tenant calls is:\n\n```java\nDeviceType type = getClient().getDeviceTypeByToken(SiteWhereClient.defaultTenant(), \"galaxytab3\");\n```\n\nfor the default tenant installed with the contruction example data, or for an arbitrary tenant\n\n```java\nDeviceType type = getClient().getDeviceTypeByToken(SiteWhereClient.forTenant(\"token\", \"auth\"), \"galaxytab3\");\n```\n\nusing the unique token for the tenant and the tenant authentication token specific to that tenant.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitewhere%2Fsitewhere-java-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitewhere%2Fsitewhere-java-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitewhere%2Fsitewhere-java-api/lists"}