1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-25 21:39:21 +02:00
2024-08-20 13:11:21 +03:00

48 lines
1.1 KiB
Markdown

---
sidebar_position: 5
---
# Upload file by URL
Uploads a file to the cloud drive by fetching it from the specified URL
`Function UploadFileByURL(Val Token, Val FileURL, Val Path) Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Token | --token | String | Token |
| FileURL | --url | String | URL source of the file |
| Path | --path | String | Save path on Dropbox |
Returns: Map Of KeyAndValue - serialized JSON response from Dropbox
<br/>
```bsl title="Code example"
Path = "/New/url_doc.docx";
Token = "sl.B7RRdlnDML6hoVUHl6bk7CQxx0SFu8rLlSxh2VTkVQIh_m6CJKk_MYsdfWowBOji0Gn-hg1kNb...";
URL = "https://openintegrations.dev/test_data/document.docx";
Result = OPI_Dropbox.UploadFileByURL(Token, URL, Path);
```
```sh title="CLI command example"
oint dropbox UploadFileByURL --token "sl.B6AQWp9MlZlz4iaf41whVKxX9-MXeCiQhPRe4YIRxFmZ3zHsdjmOAatzgaWVhqmlIOvDD6WIUQ..." --url %url% --path %path%
```
```json title="Result"
{
".tag": "async_job_id",
"async_job_id": "41d0vPCn2mYAAAAAAAAAAQ"
}
```