Class AsyncRawDataEventsClient
- java.lang.Object
-
- com.intercom.api.resources.unstable.dataevents.AsyncRawDataEventsClient
-
public class AsyncRawDataEventsClient extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientOptionsclientOptions
-
Constructor Summary
Constructors Constructor Description AsyncRawDataEventsClient(ClientOptions clientOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>>createDataEvent(java.lang.Object request)You will need an Access Token that has write permissions to send Events.java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>>createDataEvent(java.lang.Object request, RequestOptions requestOptions)You will need an Access Token that has write permissions to send Events.java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>>dataEventSummaries()Create event summaries for a user.java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>>dataEventSummaries(CreateDataEventSummariesRequest request)Create event summaries for a user.java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>>dataEventSummaries(CreateDataEventSummariesRequest request, RequestOptions requestOptions)Create event summaries for a user.java.util.concurrent.CompletableFuture<IntercomHttpResponse<DataEventSummary>>lisDataEvents(LisDataEventsRequest request)🚧java.util.concurrent.CompletableFuture<IntercomHttpResponse<DataEventSummary>>lisDataEvents(LisDataEventsRequest request, RequestOptions requestOptions)🚧
-
-
-
Field Detail
-
clientOptions
protected final ClientOptions clientOptions
-
-
Constructor Detail
-
AsyncRawDataEventsClient
public AsyncRawDataEventsClient(ClientOptions clientOptions)
-
-
Method Detail
-
lisDataEvents
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<DataEventSummary>> lisDataEvents(LisDataEventsRequest request)
🚧
Please note that you can only 'list' events that are less than 90 days old. Event counts and summaries will still include your events older than 90 days but you cannot 'list' these events individually if they are older than 90 days
The events belonging to a customer can be listed by sending a GET request to
https://api.intercom.io/eventswith a user or lead identifier along with atypeparameter. The identifier parameter can be one ofuser_id,emailorintercom_user_id. Thetypeparameter value must beuser.https://api.intercom.io/events?type=user&user_id={user_id}https://api.intercom.io/events?type=user&email={email}https://api.intercom.io/events?type=user&intercom_user_id={id}(this call can be used to list leads)
The
emailparameter value should be url encoded when sending.You can optionally define the result page size as well with the
per_pageparameter.
-
lisDataEvents
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<DataEventSummary>> lisDataEvents(LisDataEventsRequest request, RequestOptions requestOptions)
🚧
Please note that you can only 'list' events that are less than 90 days old. Event counts and summaries will still include your events older than 90 days but you cannot 'list' these events individually if they are older than 90 days
The events belonging to a customer can be listed by sending a GET request to
https://api.intercom.io/eventswith a user or lead identifier along with atypeparameter. The identifier parameter can be one ofuser_id,emailorintercom_user_id. Thetypeparameter value must beuser.https://api.intercom.io/events?type=user&user_id={user_id}https://api.intercom.io/events?type=user&email={email}https://api.intercom.io/events?type=user&intercom_user_id={id}(this call can be used to list leads)
The
emailparameter value should be url encoded when sending.You can optionally define the result page size as well with the
per_pageparameter.
-
createDataEvent
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>> createDataEvent(java.lang.Object request)
You will need an Access Token that has write permissions to send Events. Once you have a key you can submit events via POST to the Events resource, which is located at https://api.intercom.io/events, or you can send events using one of the client libraries. When working with the HTTP API directly a client should send the event with aContent-Typeofapplication/json.When using the JavaScript API, adding the code to your app makes the Events API available. Once added, you can submit an event using the
trackEventmethod. This will associate the event with the Lead or currently logged-in user or logged-out visitor/lead and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event.With the Ruby client you pass a hash describing the event to
Intercom::Event.create, or call thetrack_usermethod directly on the current user object (e.g.user.track_event).NB: For the JSON object types, please note that we do not currently support nested JSON structure.
| Type | Description | Example | | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | | String | The value is a JSON String |
"source":"desktop"| | Number | The value is a JSON Number |"load": 3.67| | Date | The key ends with the String_dateand the value is a Unix timestamp, assumed to be in the UTC timezone. |"contact_date": 1392036272| | Link | The value is a HTTP or HTTPS URI. |"article": "https://example.org/ab1de.html"| | Rich Link | The value is a JSON object that containsurlandvaluekeys. |"article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}| | Monetary Amount | The value is a JSON object that containsamountandcurrencykeys. Theamountkey is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99. |"price": {"amount": 34999, "currency": "eur"}|Lead Events
When submitting events for Leads, you will need to specify the Lead's
id.Metadata behaviour
- We currently limit the number of tracked metadata keys to 10 per event. Once the quota is reached, we ignore any further keys we receive. The first 10 metadata keys are determined by the order in which they are sent in with the event.
- It is not possible to change the metadata keys once the event has been sent. A new event will need to be created with the new keys and you can archive the old one.
- There might be up to 24 hrs delay when you send a new metadata for an existing event.
Event de-duplication
The API may detect and ignore duplicate events. Each event is uniquely identified as a combination of the following data - the Workspace identifier, the Contact external identifier, the Data Event name and the Data Event created time. As a result, it is strongly recommended to send a second granularity Unix timestamp in the
created_atfield.Duplicated events are responded to using the normal
202 Acceptedcode - an error is not thrown, however repeat requests will be counted against any rate limit that is in place.HTTP API Responses
- Successful responses to submitted events return
202 Acceptedwith an empty body. - Unauthorised access will be rejected with a
401 Unauthorizedor403 Forbiddenresponse code. - Events sent about users that cannot be found will return a
404 Not Found. - Event lists containing duplicate events will have those duplicates ignored.
- Server errors will return a
500response code and may contain an error message in the body.
-
createDataEvent
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>> createDataEvent(java.lang.Object request, RequestOptions requestOptions)
You will need an Access Token that has write permissions to send Events. Once you have a key you can submit events via POST to the Events resource, which is located at https://api.intercom.io/events, or you can send events using one of the client libraries. When working with the HTTP API directly a client should send the event with aContent-Typeofapplication/json.When using the JavaScript API, adding the code to your app makes the Events API available. Once added, you can submit an event using the
trackEventmethod. This will associate the event with the Lead or currently logged-in user or logged-out visitor/lead and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event.With the Ruby client you pass a hash describing the event to
Intercom::Event.create, or call thetrack_usermethod directly on the current user object (e.g.user.track_event).NB: For the JSON object types, please note that we do not currently support nested JSON structure.
| Type | Description | Example | | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | | String | The value is a JSON String |
"source":"desktop"| | Number | The value is a JSON Number |"load": 3.67| | Date | The key ends with the String_dateand the value is a Unix timestamp, assumed to be in the UTC timezone. |"contact_date": 1392036272| | Link | The value is a HTTP or HTTPS URI. |"article": "https://example.org/ab1de.html"| | Rich Link | The value is a JSON object that containsurlandvaluekeys. |"article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}| | Monetary Amount | The value is a JSON object that containsamountandcurrencykeys. Theamountkey is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99. |"price": {"amount": 34999, "currency": "eur"}|Lead Events
When submitting events for Leads, you will need to specify the Lead's
id.Metadata behaviour
- We currently limit the number of tracked metadata keys to 10 per event. Once the quota is reached, we ignore any further keys we receive. The first 10 metadata keys are determined by the order in which they are sent in with the event.
- It is not possible to change the metadata keys once the event has been sent. A new event will need to be created with the new keys and you can archive the old one.
- There might be up to 24 hrs delay when you send a new metadata for an existing event.
Event de-duplication
The API may detect and ignore duplicate events. Each event is uniquely identified as a combination of the following data - the Workspace identifier, the Contact external identifier, the Data Event name and the Data Event created time. As a result, it is strongly recommended to send a second granularity Unix timestamp in the
created_atfield.Duplicated events are responded to using the normal
202 Acceptedcode - an error is not thrown, however repeat requests will be counted against any rate limit that is in place.HTTP API Responses
- Successful responses to submitted events return
202 Acceptedwith an empty body. - Unauthorised access will be rejected with a
401 Unauthorizedor403 Forbiddenresponse code. - Events sent about users that cannot be found will return a
404 Not Found. - Event lists containing duplicate events will have those duplicates ignored.
- Server errors will return a
500response code and may contain an error message in the body.
-
dataEventSummaries
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>> dataEventSummaries()
Create event summaries for a user. Event summaries are used to track the number of times an event has occurred, the first time it occurred and the last time it occurred.
-
dataEventSummaries
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>> dataEventSummaries(CreateDataEventSummariesRequest request)
Create event summaries for a user. Event summaries are used to track the number of times an event has occurred, the first time it occurred and the last time it occurred.
-
dataEventSummaries
public java.util.concurrent.CompletableFuture<IntercomHttpResponse<java.lang.Void>> dataEventSummaries(CreateDataEventSummariesRequest request, RequestOptions requestOptions)
Create event summaries for a user. Event summaries are used to track the number of times an event has occurred, the first time it occurred and the last time it occurred.
-
-