---
title: getMandatorId
slug: campaign/docs/getmandatorid-mailid
docTags: 
createdAt: 2026-07-02T19:01:45.566Z
---

Throws an exception if the current logged in user has no permission for the client to which the mail ID belongs.

**Type**: long

**Parameters**

| Name      | Type   | Value             |
| --------- | ------ | ----------------- |
| sessionId | String | ID of the session |
| mailId    | String | Mail ID           |

**Return values**

Client ID

**Code structure**

```javascript
long getMandatorId(String sessionId, String mailId)
```
