-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
Description
- Via the API it is possible to list conversations by via a GET to the
/conversationsendpoint withsortororderparameters - If you try this via this library you get an error:
a user or admin type must be supplied for a conversation query
API docs
https://developers.intercom.com/reference#section-all-conversations

Reason for failture
This validation currently prevents listing by conversations
intercom-java/intercom-java/src/main/java/io/intercom/api/Conversation.java
Lines 144 to 146 in 71439e5
| if (!params.containsKey("type")) { | |
| throw new InvalidException("a user or admin type must be supplied for a conversation query"); | |
| } |
Version info
- intercom-java version: 2.2.11
- Java version: 1.8.0_101
Expected behavior
List all conversations
Actual behavior
Exception and no API call made
Steps to reproduce
- Run code with the following code
Map<String, String> params = Maps.newHashMap();
params.put("order", "created_at");
ConversationCollection conversations = Conversation.list(params);
Logs
Exception in thread "main" io.intercom.api.InvalidException: a user or admin type must be supplied for a conversation query
at io.intercom.api.Conversation.validateListRequest(Conversation.java:145)
at io.intercom.api.Conversation.list(Conversation.java:45)
at org.thewheatfield.intercom.java.example.Main.main(Main.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
