---
title: getRecipientResponseCount2
slug: campaign-dev-docs/getrecipientresponsecount2
createdAt: 2026-07-02T19:01:46.737Z
---

**Type**: int

**Parameters**

| Name        | Type   | Value                                                                                               |
| ----------- | ------ | --------------------------------------------------------------------------------------------------- |
| sessionId   | String | ID of the session                                                                                   |
| category    | String | See [Response categories](https://docs.optimizely.com/campaign-dev-docs/responsewebservice).        |
| recipientId | String | ID of the recipient                                                                                 |
| mailingId   | long   | ID of the mailing<br /><br />(Optional) If committed, only responses from this mailing are counted. |

**Return values**

Number of responses of the given type for the recipient

**Code structure**

```java
int getRecipientResponseCount2(String sessionId, String category, String recipientId, long mailingId)
```
