Skip to content

Unsubscribe Event Request

The data collector unsubscribe event request provides user to cancels the registered event subscription.

Note that although these requests do currently support "asyncCall" API, using the synchronous "execute" API is recommended since it is a non-blocking call.

Please see the API reference for the main classes related to Data Collector.

Unsubscribe Event

This API is the inverse of the SubscribeEventRequest that cancels the registered event subscription.

Key methods

Method Details
setConsumerName(String consumerName) Set the consumer name as an identifier for DataCollector
setEventTypeList(EventType[] eventTypeList) Set the list of event types to unsubscribe

Sample code

1
2
3
4
5
UnsubscribeEventRequest.Builder builder = client.unsubscribeEventRequest();
UnsubscribeEventResponse response = builder
    .setConsumerName("consumerName1")
    .setEventTypeList(EventType.Vehicle.values())
    .build().execute();
1
2
3
4
5
var builder = client.unsubscribeEventRequest()
var response = builder
    .setConsumerName("consumerName1")
    .setEventTypeList(EventType.Vehicle.values())
    .build().execute()

Response example

1
2
3
4
5
{
  "code": "SUCCESS",
  "message": "UnsubscribeEventResponse Success",
  "response_time": 1
}