{"id":21152110,"url":"https://github.com/mailjet/mailjet-apiv3-java","last_synced_at":"2025-04-12T21:30:00.512Z","repository":{"id":12669863,"uuid":"15341824","full_name":"mailjet/mailjet-apiv3-java","owner":"mailjet","description":"[API v3] Mailjet Java API Wrapper","archived":false,"fork":false,"pushed_at":"2025-03-31T00:21:13.000Z","size":9012,"stargazers_count":67,"open_issues_count":17,"forks_count":37,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-04T01:08:46.003Z","etag":null,"topics":["email","java","java-wrapper","mailjet","mailjet-api","transactional-emails","wrapper"],"latest_commit_sha":null,"homepage":"https://dev.mailjet.com","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/mailjet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-20T15:37:10.000Z","updated_at":"2025-03-27T09:52:24.000Z","dependencies_parsed_at":"2024-11-20T11:18:42.476Z","dependency_job_id":"471434df-eade-4c39-9ae8-40d9fa5db216","html_url":"https://github.com/mailjet/mailjet-apiv3-java","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailjet%2Fmailjet-apiv3-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailjet%2Fmailjet-apiv3-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailjet%2Fmailjet-apiv3-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mailjet%2Fmailjet-apiv3-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mailjet","download_url":"https://codeload.github.com/mailjet/mailjet-apiv3-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248634791,"owners_count":21137118,"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":["email","java","java-wrapper","mailjet","mailjet-api","transactional-emails","wrapper"],"created_at":"2024-11-20T10:24:56.880Z","updated_at":"2025-04-12T21:30:00.486Z","avatar_url":"https://github.com/mailjet.png","language":"Java","readme":"\n[api_credential]: https://app.mailjet.com/account/api_keys\n[doc]: http://dev.mailjet.com/guides/?java#\n[smsDashboard]:https://app.mailjet.com/sms?_ga=2.81581655.1972348350.1522654521-1279766791.1506937572\n[smsInfo]:https://app.mailjet.com/docs/transactional-sms?_ga=2.183303910.1972348350.1522654521-1279766791.1506937572#trans-sms-token\n[mailjet]: http://www.mailjet.com\n\n![alt text](https://www.mailjet.com/images/email/transac/logo_header.png \"Mailjet\")\n\n# Official Mailjet Java Wrapper\n\n\n[![Build Status](https://travis-ci.org/mailjet/mailjet-apiv3-java.svg?branch=master)](https://travis-ci.org/mailjet/mailjet-apiv3-java)\n\n## Overview\n\nThis repo features the official Java wrapper for the Mailjet API.\n\nCheck out all the resources and all the Java code examples in the [Official Documentation][doc].\n\n## Table of contents\n\n- [Release notes](#release-notes)\n- [Compatibility](#compatibility)\n- [Installation (Maven)](#installation-maven)\n- [Authentication](#authentication)\n- [Make your first call](#make-your-first-call)\n- [Client / Call configuration specifics](#client--call-configuration-specifics)\n  - [Options](#options)\n    - [API versioning](#api-versioning)\n    - [Base URL](#base-url)\n  - [Use HTTP proxy](#use-http-proxy)\n- [List of resources](#list-of-resources)\n- [Request examples](#request-examples)\n  - [POST request](#post-request)\n    - [Simple POST request](#simple-post-request)\n    - [Using actions](#using-actions)\n  - [GET request](#get-request)\n    - [Retrieve all objects](#retrieve-all-objects)\n    - [Use filtering](#use-filtering)\n    - [Retrieve a single object](#retrieve-a-single-object)\n  - [PUT request](#put-request)\n  - [DELETE request](#delete-request)\n- [SMS API](#sms-api)\n  - [Token authentication](#token-authentication)\n  - [Example Request](#example-request)\n- [Other Examples](#other-examples)\n- [Contribute](#contribute)\n\n\n## Release notes\nv5.2.6\n- fixed vulnerabilities\n- moved to Java 11\n\nv5.2.5\n- update dependency versions\n\nv5.2.4\n- add ability to attach the file into request\n- fix for uploading CSV file through the DATA API\n\nv5.2.3\n- update dependency versions\n\nv5.2.2\n- add constant for \"Globals\" in Emailv31\n\nv5.2.1\n- update dependency versions\n\nv5.2.0\n- added async methods\n- added automatic module nam\n- added possibility to create attachments form the InputStream\n\nv5.1.1\n- fixes adding additional quotes during serialization of string variables adn headers in TransactionalEmailBuilder\n\nv5.1.0\n- downgraded OkHttpClient to v3.12 to be compatible with the current version in Spring Boot\n- adds [transactional email builder](src/test/java/com/mailjet/client/TransactionalEmailBuilderIT.java) to make possible sending messages easier \n\nv5.0.0\n- migrated to more reliable OkHttpClient\n- removed ApiVersion from the MailjetClient configuration: Now the client will determine the needed API version from the resource itself.\n- added ClientOptions builder to make configuration more explicit. If you have troubles with migration, please, check [tests](src/test/java/com/mailjet/client/SendIT.java) for more examples. \n\n## Compatibility\n\nThis library requires Java version 1.8 or higher.\n\n## Installation (Maven)\n\nAdd the following in your `pom.xml`\n\n``` xml\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.mailjet\u003c/groupId\u003e\n            \u003cartifactId\u003emailjet-client\u003c/artifactId\u003e\n            \u003cversion\u003e5.2.6\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\n## Authentication\n\nThe Mailjet Email API uses your API and Secret keys for authentication. [Grab][api_credential] and save your Mailjet API credentials.\n\n```bash\nexport MJ_APIKEY_PUBLIC='your API key'\nexport MJ_APIKEY_PRIVATE='your API secret'\n```\n\n\u003e Note: The SMS API authorization is based on a Bearer token. See information about it in the [SMS API](#sms-api) section of the readme.\n\nInitialize your [Mailjet][mailjet] Client:\n\n_Hint: register MailjetClient as a **Singleton** and reuse it during sending emails to reduce resource consumption_\n\n```java\n\n        ClientOptions options = ClientOptions.builder()\n                .apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\"))\n                .apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\"))\n                .build();\n\n        MailjetClient client = new MailjetClient(options);\n\n```\n\n## Make your first call\n\nHere's an example on how to send a transactional email:\n```java\n        TransactionalEmail message1 = TransactionalEmail\n                .builder()\n                .to(new SendContact(senderEmail, \"stanislav\"))\n                .from(new SendContact(senderEmail, \"Mailjet integration test\"))\n                .htmlPart(\"\u003ch1\u003eThis is the HTML content of the mail\u003c/h1\u003e\")\n                .subject(\"This is the subject\")\n                .trackOpens(TrackOpens.ENABLED)\n                .attachment(Attachment.fromFile(attachmentPath))\n                .header(\"test-header-key\", \"test-value\")\n                .customID(\"custom-id-value\")\n                .build();\n\n        SendEmailsRequest request = SendEmailsRequest\n                .builder()\n                .message(message1) // you can add up to 50 messages per request\n                .build();\n\n        // act\n        SendEmailsResponse response = request.sendWith(client);\n\n```\n\nOr using an old JSONObject syntax:\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.ClientOptions;\nimport com.mailjet.client.resource.Emailv31;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Run:\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetRequest request;\n      MailjetResponse response;\n\n      ClientOptions options = ClientOptions.builder()\n            .apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\"))\n            .apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\"))\n            .build();\n      \n      MailjetClient client = new MailjetClient(options);\n\n      request = new MailjetRequest(Emailv31.resource)\n            .property(Emailv31.MESSAGES, new JSONArray()\n                .put(new JSONObject()\n                    .put(Emailv31.Message.FROM, new JSONObject()\n                        .put(\"Email\", \"$SENDER_EMAIL\")\n                        .put(\"Name\", \"Me\"))\n                    .put(Emailv31.Message.TO, new JSONArray()\n                        .put(new JSONObject()\n                            .put(\"Email\", \"$RECIPIENT_EMAIL\")\n                            .put(\"Name\", \"You\")))\n                    .put(Emailv31.Message.SUBJECT, \"My first Mailjet Email!\")\n                    .put(Emailv31.Message.TEXTPART, \"Greetings from Mailjet!\")\n                    .put(Emailv31.Message.HTMLPART, \"\u003ch3\u003eDear passenger 1, welcome to \u003ca href=\\\"https://www.mailjet.com/\\\"\u003eMailjet\u003c/a\u003e!\u003c/h3\u003e\u003cbr /\u003eMay the delivery force be with you!\")));\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n## Client / Call configuration specifics\n\nTo instantiate the library you can use the following constructor:  \n\n```java\n        ClientOptions options = ClientOptions.builder()\n                .apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\"))\n                .apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\"))\n                .build();\n\n        MailjetClient client = new MailjetClient(options);\n```\n\n### Options\n\n#### Set connection timeouts and log requests \n\nYou can pass a custom configured HttpClient to the Mailjet client to get request logs or custom timeouts:\n\n```java\n        HttpLoggingInterceptor logging = new HttpLoggingInterceptor();\n        logging.setLevel(Level.BASIC);\n    \tOkHttpClient customHttpClient = new OkHttpClient.Builder()\n                .connectTimeout(60, TimeUnit.SECONDS)\n                .readTimeout(60, TimeUnit.SECONDS)\n                .writeTimeout(60, TimeUnit.SECONDS)\n                .addInterceptor(logging)\n                .build();\n\n        ClientOptions options = ClientOptions.builder()\n                .apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\"))\n                .apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\"))\n                .okHttpClient(customHttpClient)\n                .build();\n\n```\n\nfor more configuration options, please, refer to the [OkHttpClient documentation](https://square.github.io/okhttp/)\n\n#### API Versioning\n\nThe Mailjet API is spread among three distinct versions:\n\n- `v3` - The Email API\n- `v3.1` - Email Send API v3.1, which is the latest version of our Send API\n- `v4` - SMS API\n\nYou can skip version specification during the request, as MailJet client will determine the needed API version by himself.\n\n\nFor additional information refer to our [API Reference](https://dev.preprod.mailjet.com/reference/overview/versioning/).\n\n#### Base URL\n\nThe default base domain name for the Mailjet API is api.mailjet.com. You can modify this base URL by adding a different URL in `ClientOptions`:\n\n```java\n        ClientOptions options = ClientOptions.builder()\n                .baseUrl(\"https://api.us.mailjet.com\")\n                .apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\"))\n                .apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\"))\n                .build();\n\n        MailjetClient client = new MailjetClient(options);\n```\n\nIf your account has been moved to Mailjet's **US architecture**, the URL you need to add is `https://api.us.mailjet.com`.\n\n### Use HTTP proxy\n\nThe proxy can be set using the following system properties:\n\n``` java\nHTTP proxy\n-Dhttp.proxyHost=\n-Dhttp.proxyPort=\n\nHTTPS proxy\n-Dhttps.proxyHost=\n-Dhttps.proxyPort=\n```\n\nIf you communicate with other endpoints using java.net.HttpURLConnection and you don't need proxy for them:\n\n``` java\n-Dhttp.nonProxyHosts=\u003cany host you don't want to be proxied\u003e\n```\n\n## List of resources\n\nYou can find the list of all available resources for this library, as well as their configuration, in [src/main/java/com/mailjet/client/resource](https://github.com/mailjet/mailjet-apiv3-java/blob/master/src/main/java/com/mailjet/client/resource).\n\n## Request examples\n\n### POST Request\n\nUse the `Post` method of the Mailjet CLient (i.e. `response = client.post(request);`).\n`request` will be a `MailjetRequest` object.\n\n#### Simple POST request\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Contact;\n\npublic class MyClass {\n    /**\n     * Create a contact\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n      request = new MailjetRequest(Contact.resource)\n            .property(Contact.EMAIL, \"Mister@mailjet.com\");\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n\n```\n\n#### Using actions\n\nTo access endpoints with action, you will be able to find Resources object definition. For example, the `/Contact/$ID/Managecontactslists` endpoint can be used with the object `ContactManagecontactslists` available in `com.mailjet.client.resource` \n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.ContactManagecontactslists;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Create : Manage a contact subscription to a list\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n      request = new MailjetRequest(ContactManagecontactslists.resource, ID)\n            .property(ContactManagecontactslists.CONTACTSLISTS, new JSONArray()\n                .put(new JSONObject()\n                    .put(\"ListID\", \"$ListID_1\")\n                    .put(\"Action\", \"addnoforce\"))\n                .put(new JSONObject()\n                    .put(\"ListID\", \"$ListID_2\")\n                    .put(\"Action\", \"addforce\")));\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n### GET Request\n\nUse the `get` method of the Mailjet CLient (i.e. `response = client.get(request);`).\n`request` will be a `MailjetRequest` object.\n\n#### Retrieve all objects\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Contact;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Run :\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n\n      request = new MailjetRequest(Contact.resource);\n      response = client.get(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n#### Use filtering and sorting\n\nYou can add filter to your API call on the `MailjetRequest` by using the `filter` method.\nSorting is also possible, with specification the field name and order (ASC or DESC) separated by space.\nNote: Both the Sort query parameter, and the option to select a descending order are not available for every property.\nExample:\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Message;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Run :\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n\n      request = new MailjetRequest(Contact.resource)\n            .filter(Contact.ISEXCLUDEDFROMCAMPAIGNS, \"false\")\n            .filter(\"Sort\", \"CreatedAt DESC\");\n      response = client.get(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n#### Retrieve a single object\n\nWhen instantiating the `MailjetRequest`, you can specify the Id of the resource you want to access.\n(example: `request = new MailjetRequest(Contact.resource, ID);`).\n\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Contact;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Run :\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n\n      request = new MailjetRequest(Contact.resource, ID);\n      response = client.get(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n### PUT Request\n\nA `PUT` request in the Mailjet API will work as a `PATCH` request - the update will affect only the specified properties. The other properties of an existing resource will neither be modified, nor deleted. It also means that all non-mandatory properties can be omitted from your payload.\n\nUse the `put` method of the Mailjet CLient (i.e. `response = client.put(request);`).\n`request` will be a `MailjetRequest` object.\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Contactdata;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Modify : Modify the static custom contact data\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n\n      request = new MailjetRequest(Contactdata.resource, ID)\n            .property(Contactdata.DATA, new JSONArray()\n                .put(new JSONObject()\n                    .put(\"Name\", \"Age\")\n                    .put(\"value\", \"30\"))\n                .put(new JSONObject()\n                    .put(\"Name\", \"Country\")\n                    .put(\"value\", \"US\")));\n      response = client.put(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n### DELETE Request\n\nUpon a successful `DELETE` request the response will not include a response body, but only a `204 No Content` response code.\n\nHere's an example of a `DELETE` request:\n\n```java\npackage com.my.project;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Template;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * Delete a Template\n     */\n    public static void main(String[] args) throws MailjetException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(ClientOptions.builder().apiKey(System.getenv(\"MJ_APIKEY_PUBLIC\")).apiSecretKey(System.getenv(\"MJ_APIKEY_PRIVATE\")).build());\n\n      request = new MailjetRequest(Template.resource, ID);\n      response = client.delete(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n```\n\n## SMS API\n\n### Token Authentication\n\nAuthentication for the SMS API endpoints is done using a bearer token. The bearer token generated in the [SMS section](https://app.mailjet.com/sms) of your Mailjet account.\n\n### Example request\n\nAn example SMS API request:\n\n``` java\n\nMailjetClient client;\nMailjetRequest request;\nMailjetResponse response;\n\nMailjetClient mailjetClient = new MailjetClient(ClientOptions\n                .builder()\n                .bearerAccessToken(System.getenv(\"MJ_APITOKEN\"))\n                .build());\n\nString germanyPhoneNumber = \"+4915207831169\";\n\nMailjetRequest mailjetRequest = new MailjetRequest(SmsSend.resource)\n                .property(SmsSend.FROM, \"MJPilot\")\n                .property(SmsSend.TO, germanyPhoneNumber)\n                .property(SmsSend.TEXT, \"Have a nice SMS flight with Mailjet!\");\n\n// send the request\nMailjetResponse response = mailjetClient.post(mailjetRequest);\n\n// assert response\nAssert.assertEquals(200, response.getStatus());\nAssert.assertEquals(\"Message is being sent\", response.getData().getJSONObject(0).getJSONObject(\"Status\").getString(\"Description\"));\n\n```\nAlso, you can check [integration tests](src/test/java/com/mailjet/client/SendSmsIT.java) how to work with Mailjet client. \n\n## Other examples\n\n- [AWS Lambda](https://github.com/fouad-j/aws-lambda-java-jetmail)\n\n## Contribute\n\nMailjet loves developers. You can be part of this project!\n\nThis wrapper is a great introduction to the open source world, check out the code!\n\nFeel free to ask anything, and contribute:\n\n - Fork the project.\n - Create a new branch.\n - Implement your feature or bug fix.\n - Add documentation for it.\n - Add specs for your feature or bug fix.\n - Commit and push your changes.\n - Submit a pull request.\n\n If you have suggestions on how to improve the guides, please submit an issue in our [Official API Documentation repo](https://github.com/mailjet/api-documentation).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailjet%2Fmailjet-apiv3-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmailjet%2Fmailjet-apiv3-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmailjet%2Fmailjet-apiv3-java/lists"}