Skip to content

Commit fa91fc1

Browse files
committed
Merge pull request #84 from intercom/Ruairik/update_error_feed_docs
Document error feed
2 parents 8e39d1f + 3a20966 commit fa91fc1

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

README.md

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Java bindings for the [Intercom API](https://api.intercom.io/docs)
1616

1717
[ ![Download](https://api.bintray.com/packages/intercom/intercom-maven/intercom-java/images/download.svg) ](https://bintray.com/intercom/intercom-maven/intercom-java/_latestVersion)
1818

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.
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.
2121

2222
### maven
2323

@@ -31,9 +31,9 @@ Add jcenter to your repositories in `pom.xml` or `settings.xml`:
3131
</repository>
3232
</repositories>
3333
```
34-
34+
3535
and add the project declaration to your `pom.xml`:
36-
36+
3737
```xml
3838
<dependency>
3939
<groupId>io.intercom</groupId>
@@ -152,6 +152,9 @@ final List<JobItem<User>> moreItems = Lists.newArrayList();
152152
items.add(new JobItem<User>("post", user4));
153153
items.add(new JobItem<User>("delete", user5));
154154
User.submit(moreItems, job);
155+
156+
//View a bulk job error feed
157+
User.listJobErrorFeed(jobId)
155158
```
156159

157160
### Contacts
@@ -188,7 +191,7 @@ while(allContacts.hasNext()) {
188191
// Remove a contact
189192
Contact.delete(contact);
190193
191-
// Convert a contact
194+
// Convert a contact
192195
User converted = Contact.convert(contact, user);
193196
```
194197
@@ -272,6 +275,9 @@ final List<JobItem<Event>> moreItems = Lists.newArrayList();
272275
items.add(new JobItem<Event>("post", event4));
273276
items.add(new JobItem<Event>("delete", event5));
274277
Event.submit(moreItems, job);
278+
279+
//View a bulk job error feed
280+
Event.listJobErrorFeed(jobId)
275281
```
276282
277283
@@ -319,13 +325,13 @@ Segment segment = Segment.find("1");
319325
// Update a segment
320326
segment.setName("new name");
321327
Segment.update(segment);
322-
328+
323329
// Iterate over all segments
324330
SegmentCollection segments = Segment.list();
325331
while(segments.hasNext()) {
326332
System.out.println(segments.next().getId());
327333
}
328-
```
334+
```
329335

330336
### Notes
331337

@@ -429,7 +435,7 @@ ConversationCollection openForAdmin = Conversation.list(params);
429435
Admin admin = new Admin().setId("1");
430436
AdminReply adminReply = new AdminReply(admin);
431437
adminReply.setBody("These apples are healthsome");
432-
Conversation.reply("66", adminReply);
438+
Conversation.reply("66", adminReply);
433439

434440
// admin close
435441
Admin admin = new Admin().setId("1");
@@ -554,40 +560,40 @@ for (Counts.CountItem tag : companyTags) {
554560
}
555561
```
556562

557-
## Idioms
563+
## Idioms
558564

559565
### HTTP requests
560566

561-
To signal local versus remote methods, calls that result in HTTP requests are performed
562-
using static methods, for example `User.find()`. The objects returned by static methods
563-
are built from server responses. The exception to the static idiom is where the `next()`,
567+
To signal local versus remote methods, calls that result in HTTP requests are performed
568+
using static methods, for example `User.find()`. The objects returned by static methods
569+
are built from server responses. The exception to the static idiom is where the `next()`,
564570
`hasNext()` and `nextPage()` methods on Collections are used to abstract over pagination.
565571

566572
### Pagination
567573

568-
Some API classes have static `list()` methods that correspond to paginated API responses.
569-
These return a Collection object (eg `UserCollection`) which can be iterated in two
574+
Some API classes have static `list()` methods that correspond to paginated API responses.
575+
These return a Collection object (eg `UserCollection`) which can be iterated in two
570576
ways
571-
577+
572578
- The collection's `getPageItems()`, `hasNextPage()` and `nextPage()` methods - these are useful when you want to fetch one or just a few pages directly.
573579
574-
- Java's inbuilt iterator methods `next()` and `hasNext()` - these are useful when you want to fetch data without manually handling pagination.
580+
- Java's inbuilt iterator methods `next()` and `hasNext()` - these are useful when you want to fetch data without manually handling pagination.
575581

576582
### Error handling
577583

578-
You do not need to deal with the HTTP response from an API call directly.
579-
If there is an unsuccessful response then an IntercomException or a subclass
580-
of IntercomException will be thrown. The exception will have Error objects
581-
that can be examined via `getErrorCollection` and `getFirstError` for more detail.
582-
584+
You do not need to deal with the HTTP response from an API call directly.
585+
If there is an unsuccessful response then an IntercomException or a subclass
586+
of IntercomException will be thrown. The exception will have Error objects
587+
that can be examined via `getErrorCollection` and `getFirstError` for more detail.
588+
583589
The API throws the following runtime exceptions -
584-
585-
- AuthorizationException: for a 401 or 403 response
586-
- InvalidException: for a 422 response or a local validation failure
590+
591+
- AuthorizationException: for a 401 or 403 response
592+
- InvalidException: for a 422 response or a local validation failure
587593
- RateLimitException: for a 429 rate limit exceeded response
588594
- ClientException: for a general 4xx response
589595
- ServerException: for a 500 or 503 response
590-
- IntercomException: general exception
596+
- IntercomException: general exception
591597

592598

593599
## Configuration
@@ -596,12 +602,12 @@ The API throws the following runtime exceptions -
596602

597603
The client can be configured to accept any http stack that implements
598604
`java.net.HttpURLConnection` by implementing the `HttpConnectorSupplier`
599-
interface.
600-
601-
For example, to use [OkHttp](http://square.github.io/okhttp/) as a connection
602-
supplier, create a supplier class -
603-
604-
```java
605+
interface.
606+
607+
For example, to use [OkHttp](http://square.github.io/okhttp/) as a connection
608+
supplier, create a supplier class -
609+
610+
```java
605611
public class OkHttpSupplier implements HttpConnectorSupplier {
606612
private final OkUrlFactory urlFactory;
607613

@@ -627,7 +633,7 @@ Intercom.setHttpConnectorSupplier(supplier);
627633

628634
#### Timeouts
629635

630-
The default connection and request timeouts can be set in milliseconds using the
636+
The default connection and request timeouts can be set in milliseconds using the
631637
`Intercom.setConnectionTimeout` and `Intercom.setRequestTimeout` methods.
632638

633639

0 commit comments

Comments
 (0)