﻿---
sidebar_position: 2
---

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

# Get token
 Receives authorization token by login and password



`Function GetToken(Val Login, Val Password) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Login | --login | String | &#x2714; | Users login |
  | Password | --password | String | &#x2714; | Users password |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Neocities

<br/>

:::tip
Neocities API docs: [neocities.org/api](https://neocities.org/api)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    Login    = "2athenaeum";
    Password = "Rit...";

    Result = OPI_Neocities.GetToken(Login, Password);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint neocities GetToken \
             --login "2athenaeum" \
             --password "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint neocities GetToken ^
             --login "2athenaeum" ^
             --password "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": "success",
 "api_key": "***"
}
```
