1- [ ![ Circle CI] ( https://circleci.com/gh/intercom/intercom-java.png?style=badge )] ( https://circleci.com/gh/intercom/intercom-java )
2-
31# intercom-java
42
5- Java bindings for the [ Intercom API] ( https://api.intercom.io/docs )
3+ [ ![ Circle CI] ( https://circleci.com/gh/intercom/intercom-java.svg?style=shield )] ( https://circleci.com/gh/intercom/intercom-java )
4+ [ ![ Maven Central] ( https://img.shields.io/maven-central/v/io.intercom/intercom-java.svg?label=Maven%20Central )] ( https://search.maven.org/artifact/io.intercom/intercom-java )
5+ ![ Intercom API Version] ( https://img.shields.io/badge/Intercom%20API%20Version-1.3-blue )
66
7- - [ Installation] ( #add-a-dependency )
8- - [ Resources] ( #resources )
9- - [ Authorization] ( #authorization )
10- - [ Usage] ( #usage )
11- - [ Idioms] ( #idioms )
12- - [ Configuration] ( #configuration )
7+ Java bindings for the [ Intercom API] ( https://api.intercom.io/docs )
138
9+ ## Project Updates
1410
15- ## Add a dependency
11+ ### Retirement of Bintray/JCenter
1612
17- [ ![ Download ] ( https://api.bintray.com/packages/intercom/intercom-maven/intercom-java/images/download.svg ) ] ( https://bintray.com/intercom/intercom-maven/intercom-java/_latestVersion )
13+ This project was previously publishing releases to JCenter, which is being retired by JFrog on May 1st 2021.
1814
19- The distribution is hosted on [ bintray] ( https://bintray.com/intercom/intercom-maven/intercom-java/view ) .
20- To use the client, you can add the jcenter repository to your dependencies.
15+ To allow continued access to past versions, we've migrated them to Maven Central.
2116
22- ### Maven
17+ - [ Installation] ( #add-a-dependency )
18+ - [ Resources] ( #resources )
19+ - [ Authorization] ( #authorization )
20+ - [ Usage] ( #usage )
21+ - [ Idioms] ( #idioms )
22+ - [ Configuration] ( #configuration )
2323
24+ ## Add a dependency
2425
25- Add jcenter to your repositories in ` pom.xml ` or ` settings.xml ` :
26+ The distribution is hosted on [ mavenCentral] ( https://search.maven.org/artifact/io.intercom/intercom-java ) .
27+ To use the client, you can add the mavenCentral repository to your dependencies.
2628
27- ``` xml
28- <repositories >
29- <repository >
30- <id >jcenter</id >
31- <url >https://jcenter.bintray.com</url >
32- </repository >
33- </repositories >
34- ```
29+ ### Maven
3530
36- and add the project declaration to your ` pom.xml ` :
31+ Add the project declaration to your ` pom.xml ` :
3732
3833``` xml
3934<dependency >
@@ -45,28 +40,28 @@ and add the project declaration to your `pom.xml`:
4540
4641### Gradle
4742
48- Add jcenter to your ` repositories ` block:
43+ Add mavenCentral to your ` repositories ` block:
4944
5045``` groovy
5146repositories {
52- jcenter ()
47+ mavenCentral ()
5348}
5449```
5550
5651and add the project to the ` dependencies ` block in your ` build.gradle ` :
5752
5853``` groovy
5954dependencies {
60- compile 'io.intercom:intercom-java:2.8.1'
55+ implementation 'io.intercom:intercom-java:2.8.1'
6156}
6257```
6358
6459### SBT
6560
66- Add jcenter to your ` resolvers ` in your ` build.sbt ` :
61+ Add mavenCentral to your ` resolvers ` in your ` build.sbt ` :
6762
6863``` scala
69- resolvers += " jcenter " at " https://jcenter.bintray.com "
64+ resolvers += " mavenCentral " at " https://repo1.maven.org/maven2 "
7065```
7166
7267and add the project to your ` libraryDependencies ` in your ` build.sbt ` :
@@ -75,7 +70,6 @@ and add the project to your `libraryDependencies` in your `build.sbt`:
7570libraryDependencies += " io.intercom" % " intercom-java" % " 2.8.1"
7671```
7772
78-
7973## Resources
8074
8175Resources this API supports:
@@ -90,10 +84,8 @@ Resources this API supports:
9084- [ Segments] ( #segments )
9185- [ Notes] ( #notes )
9286- [ Conversations] ( #conversations )
93- - [ Counts] ( #counts )
9487- [ Webhooks] ( #webhooks )
95-
96-
88+ - [ Counts] ( #counts )
9789
9890## Authorization
9991
@@ -103,8 +95,8 @@ Resources this API supports:
10395# With an OAuth or Access token:
10496Intercom . setToken(" da39a3ee5e6b4b0d3255bfef95601890afd80709" );
10597```
106- If you are building a third party application you can get your OAuth token by [ setting-up-oauth] ( https://developers.intercom.io/page/setting-up-oauth ) for Intercom.
10798
99+ If you are building a third party application you can get your OAuth token by [ setting-up-oauth] ( https://developers.intercom.io/page/setting-up-oauth ) for Intercom.
108100
109101## Usage
110102
@@ -250,6 +242,7 @@ User converted = Contact.convert(contact, user);
250242```
251243
252244### Visitors
245+
253246``` java
254247// Find visitor by ID
255248Visitor visitor = Visitor . findByID(" 5b69565fa737210d1c2127f1" );
@@ -348,7 +341,6 @@ Admin admin = Admin.find("123456");
348341Admin admin = Admin . setAwayMode(" 123456" , true , true );
349342```
350343
351-
352344### Events
353345
354346``` java
@@ -768,13 +760,12 @@ of IntercomException will be thrown. The exception will have Error objects
768760
769761The API throws the following runtime exceptions -
770762
771- - AuthorizationException: for a 401 or 403 response
772- - InvalidException: for a 422 response or a local validation failure
773- - RateLimitException: for a 429 rate limit exceeded response
774- - ClientException: for a general 4xx response
775- - ServerException: for a 500 or 503 response
776- - IntercomException: general exception
777-
763+ - AuthorizationException: for a 401 or 403 response
764+ - InvalidException: for a 422 response or a local validation failure
765+ - RateLimitException: for a 429 rate limit exceeded response
766+ - ClientException: for a general 4xx response
767+ - ServerException: for a 500 or 503 response
768+ - IntercomException: general exception
778769
779770## Configuration
780771
@@ -804,19 +795,18 @@ public class OkHttpSupplier implements HttpConnectorSupplier {
804795
805796and hand a supplier to the Intercom object -
806797
807- ```
798+ ``` java
808799final OkHttpClient client = new OkHttpClient ();
809800final OkUrlFactory factory = new OkUrlFactory (client);
810801final OkHttpSupplier supplier = new OkHttpSupplier (factory);
811802Intercom . setHttpConnectorSupplier(supplier);
812- ```
803+ ```
813804
814805#### Timeouts
815806
816807The default connection and request timeouts can be set in milliseconds using the
817808` Intercom.setConnectionTimeout ` and ` Intercom.setRequestTimeout ` methods.
818809
819-
820810### Target API Server
821811
822812The base URI to target can be changed for testing purposes
0 commit comments