---
sidebar_position: 3
description: Send file by URL and other functions to work with GreenMax in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, GreenMax]
---

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

# Send file by URL
 Sends a file from web to the selected chat room



`Function SendFileByURL(Val AccessParameters, Val ChatID, Val FileURL, Val FileName, Val Description = "", Val TypingTime = 0, Val TypingType = "file") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |
  | ChatID | --chat | String | &#x2714; | Chat identifier |
  | FileURL | --url | String | &#x2714; | File URL |
  | FileName | --filename | String | &#x2714; | Name of the file with the extension |
  | Description | --caption | String | &#x2716; | Message text below the file |
  | TypingTime | --typing | Number | &#x2716; | Time to show typing indicator before sending (in ms.) |
  | TypingType | --ttype | String | &#x2716; | Typing type: text, recording, video, image, file |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Green API

:::tip
Method at API documentation: [SendFileByUrl](https://green-api.com/v3/docs/api/sending/SendFileByUrl/)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    ApiUrl           = "https://3100.api.green-api.com/v3";
    MediaUrl         = "https://3100.api.green-api.com/v3";
    IdInstance       = "31003...";
    ApiTokenInstance = "17915d8e0b4b4975a183478da...";

    File        = "https://hut.openintegrations.dev/test_data/picture.jpg";
    FileName    = "photo.jpg";
    ChatID      = 12345678;
    Description = "File description";

    AccessParameters = OPI_GreenMax.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
    Result           = OPI_GreenMax.SendFileByURL(AccessParameters, ChatID, File, FileName);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint greenmax SendFileByURL \
             --access "{'apiUrl':'***','mediaUrl':'https://3100.api.green-api.com/v3','idInstance':'3100309139','apiTokenInstance':'***'}" \
             --chat "***" \
             --url "https://hut.openintegrations.dev/test_data/video.mp4" \
             --filename "vid.mp4" \
             --caption "File description" \
             --typing 1000
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint greenmax SendFileByURL ^
             --access "{'apiUrl':'***','mediaUrl':'https://3100.api.green-api.com/v3','idInstance':'3100309139','apiTokenInstance':'***'}" ^
             --chat "***" ^
             --url "https://hut.openintegrations.dev/test_data/video.mp4" ^
             --filename "vid.mp4" ^
             --caption "File description" ^
             --typing 1000
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "idMessage": "1765401105173"
}
```
