{"id":26067100,"url":"https://github.com/tcpshield/tcpshield-java-api-wrapper","last_synced_at":"2025-04-11T16:39:14.625Z","repository":{"id":38825631,"uuid":"320709434","full_name":"TCPShield/TCPShield-Java-API-Wrapper","owner":"TCPShield","description":"An official wrapper for the TCPShield API.","archived":false,"fork":false,"pushed_at":"2022-06-02T11:49:30.000Z","size":248,"stargazers_count":9,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T12:50:56.984Z","etag":null,"topics":["api","ddos-protection","rest","tcpshield","wrapper"],"latest_commit_sha":null,"homepage":"https://docs.tcpshield.com/premium-features/tcpshield-api","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TCPShield.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-11T23:47:46.000Z","updated_at":"2024-12-01T17:07:00.000Z","dependencies_parsed_at":"2022-09-18T09:13:08.823Z","dependency_job_id":null,"html_url":"https://github.com/TCPShield/TCPShield-Java-API-Wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCPShield%2FTCPShield-Java-API-Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCPShield%2FTCPShield-Java-API-Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCPShield%2FTCPShield-Java-API-Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCPShield%2FTCPShield-Java-API-Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TCPShield","download_url":"https://codeload.github.com/TCPShield/TCPShield-Java-API-Wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441900,"owners_count":21104097,"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":["api","ddos-protection","rest","tcpshield","wrapper"],"created_at":"2025-03-08T21:08:45.716Z","updated_at":"2025-04-11T16:39:14.598Z","avatar_url":"https://github.com/TCPShield.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCPShield API Wrapper\n\n![Build badge](https://ci.fuzzlemann.de/job/TCPShield-Java-API-Wrapper/badge/icon)\n\nThis is a Java wrapper for the official [TCPShield API](https://github.com/TCPShield/api-docs). \\\nThis wrapper supports every documented API endpoint, as seen in the [API Documentation](https://swagger.tcpshield.com).\n\n## Download\n\n### Option 1: Standalone Jar\n\nDownload the [latest build](https://ci.fuzzlemann.de/job/TCPShield-Java-API-Wrapper/lastBuild/) from our CI and the\nlatest [Jackson Databind](https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/) and add them both\nto your buildpath.\n\n### Option 2: Build automation tools\n\nUsing build automation tools like [Gradle](https://gradle.org/) or [Maven](https://maven.apache.org/) streamlines the\nusage of our API.\n\nsee https://jitpack.io/#TCPShield/TCPShield-Java-API-Wrapper/-SNAPSHOT\n\n## Example\n\nSimple example of setting up a network from scratch:\n\n```java\npublic class NetworkSetup {\n\n    private final APIClient apiClient = new APIClientImpl(\"APIKEY\"); // create an instance of the API Client\n    \n    public void setup(String networkName, String backend, String domainName) {\n        List\u003cNetwork\u003e networks = apiClient.getNetworks(); // fetches all networks\n\n        int networkID;\n        int domainID;\n\n        Optional\u003cNetwork\u003e foundNetwork = networks.stream().filter(network -\u003e network.getName().equals(\"TestNetwork\")).findAny(); // checks if any networks with the name \"TestNetwork\" exist\n\n        if (foundNetwork.isPresent()) { // network found\n            Network network = foundNetwork.get();\n            networkID = network.getID();\n\n            Domain foundDomain = apiClient.getDomains(networkID).stream().filter(domain -\u003e domain.getName().equals(domainName)).findAny().orElseThrow(IllegalStateException::new); // gets the ID of the domain\n            domainID = foundDomain.getID();\n        } else { // no network found\n            networkID = apiClient.addNetwork(\"TestNetwork\").getData().getNetworkID(); // adds the network\n            int backendSetID = apiClient.addBackendSet(networkID, networkName + \" Set\", backend).getData().getID(); // adds the backend set\n            domainID = apiClient.addDomain(networkID, domainName, backendSetID, false).getData().getID(); // adds the domain\n        }\n\n        if (apiClient.verify(networkID, domainID)) { // verifies the domain; true if successful, false if not\n            System.out.println(\"Successfully created the network.\");\n        } else {\n            Network network = apiClient.getNetwork(networkID); // fetches the network in order to get the TXT verification string\n\n            System.out.println(\"Create a TXT record on @ with \\\"\" + network.getTXTVerification() + \"\\\" and re-run the program.\");\n        }\n    }\n}\n```\n\n## Support\n\nIf any help with the usage of the API is needed, feel free to contact us on our [Discord](https://discord.gg/XKU9UpV).\n\n## Used Libraries\n\n* [Jackson Databind](https://github.com/FasterXML/jackson-databind)\n\n## Contributions\n\nWe're more than happy to accept contributions! We welcome pull requests with open arms.\u003cbr\u003e\nIn order to get testing to work, follow the instructions outlined [here](TESTING.md).\n\n## ToDo\n\n* adding a repository for build tools like Gradle and Maven\n* adding documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcpshield%2Ftcpshield-java-api-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcpshield%2Ftcpshield-java-api-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcpshield%2Ftcpshield-java-api-wrapper/lists"}