﻿---
sidebar_position: 1
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get current user
 Get current user data



`Function GetCurrentUser(Val URL, Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>

:::tip
Method at API documentation: [user.current](https://dev.1c-bitrix.ru/rest_help/users/user_current.php)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    URL = "https://b24-ar17wx.bitrix24.by/rest/1/ps5...";

    Result = OPI_Bitrix24.GetCurrentUser(URL);

    URL   = "b24-ar17wx.bitrix24.by";
    Token = "a8e65667006e9f06006b12e400000001000...";

    Result = OPI_Bitrix24.GetCurrentUser(URL, Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 GetCurrentUser \
             --url "b24-ar17wx.bitrix24.by" \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 GetCurrentUser ^
             --url "b24-ar17wx.bitrix24.by" ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": {
  "ID": "1",
  "XML_ID": "53818298",
  "ACTIVE": true,
  "NAME": "Антон",
  "LAST_NAME": "Титовец",
  "EMAIL": "no-reply@bitrix24.com",
  "LAST_LOGIN": "2024-09-17T21:21:38+03:00",
  "DATE_REGISTER": "2024-02-10T03:00:00+03:00",
  "IS_ONLINE": "N",
  "TIME_ZONE_OFFSET": "0",
  "TIMESTAMP_X": "29.08.2024 10:12:45",
  "LAST_ACTIVITY_DATE": "2024-09-17 21:21:49",
  "PERSONAL_GENDER": "",
  "PERSONAL_BIRTHDAY": "",
  "PERSONAL_PHOTO": "https://cdn-ru.bitrix24.by/b28528874/main/d7e/d7e99cf556e4ab676463dae2c00ddfbb/a7e0af6899300e3c684caeca5c334d81.jpg",
  "UF_EMPLOYMENT_DATE": "",
  "UF_DEPARTMENT": [
   1,
   264
  ]
 },
 "time": {
  "start": 1728454930.6427,
  "finish": 1728454930.67441,
  "duration": 0.0317108631134033,
  "processing": 0.00330090522766113,
  "date_start": "2024-10-09T09:22:10+03:00",
  "date_finish": "2024-10-09T09:22:10+03:00",
  "operating_reset_at": 1728455530,
  "operating": 0
 }
}
```
