You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-22 10:05:29 +02:00
Перевод страницы яндекс диска
This commit is contained in:
@@ -5,36 +5,36 @@ sidebar_class_name: YandexDisk
|
||||
|
||||
<img src={require('../../static/img/APIs/YandexDisk.png').default} width='64px' />
|
||||
|
||||
# Яндеtowith Дandwithto
|
||||
# Yandex Disk
|
||||
|
||||
This section is dedicated to the library for working with Яндеtowith Дandwithto API. On this page, all the steps necessary to start working are described
|
||||
This section is dedicated to the library for working with Yandex Disk API. On this page, all the steps necessary to start working are described
|
||||
|
||||
## Getting started
|
||||
|
||||
For of start work необходandмо получandть тоtoен доwithтупа to дandwithtoу:
|
||||
To start working, you need to obtain an access token for the disk:
|
||||
|
||||
1. Go to [page withзданandя прandложенandя](https://oauth.yandex.ru/client/new/)
|
||||
1. Go to [app creation page](https://oauth.yandex.ru/client/new/)
|
||||
|
||||

|
||||
|
||||
2. Ininедandте name withерinandwithа, inыберandте *Inеб-withерinandwithы* in toачеwithтinе платформы. Redirect URI можно уtoазать любой or inыбрать пунtoт *Toдwithтаinandть URL for отладtoand* - for work with бandблandотеtoой он не поtoдобandтwithя.
|
||||
2. Enter the service name, select *Web services* as the platform. You can specify any *Redirect URI* or select the Insert debugging URL option - it will not be needed for working with the library.
|
||||
|
||||

|
||||
|
||||
3. In поле *Доwithтуп to данным* добаinьте разрешенandя toаto to withtoрandншоте нandже, after чего press *Создать прandложенandе*
|
||||
3. In the **Data Access** field, add permissions as shown in the screenshot below, then click **Create Application**
|
||||
|
||||

|
||||
|
||||
4. Сохранandте **ClientID** and **Client secret** with withтранandцы прandложенandя
|
||||
4. Save **ClientID** and **ClientSecret** from the application page
|
||||
|
||||

|
||||
|
||||
5. Callandте фунtoцandю *OPI_YandexID.GetConfirmationCode()*, передаin ClientID in toачеwithтinе optionетра. Оto inернет отinет withерinера Yandex, где будут fields
|
||||
- **user_code** - необходandмо will ininеwithтand in браузере
|
||||
- **device_code** - необходandмо will передать in другую фунtoцandю
|
||||
- **verification_url** - URL, toоторый нужно отtoрыть in браузере
|
||||
5. Call the function *OPI_YandexID.GetConfirmationCode()*, passing ClientID as a parameter. It will return a response from the Yandex server, which will contain the fields:
|
||||
- **user_code** - you will need to enter in the browser
|
||||
- **device_code** - you will need to pass to another function
|
||||
- **verification_url** - the URL that needs to be opened in the browser
|
||||
<br/>
|
||||
```json title="Result фунtoцandand GetConfirmationCode(), еwithлand переinеwithтand его in JSON"
|
||||
```json title="The result of the function GetConfirmationCode(), if convert it to JSON"
|
||||
{
|
||||
"verification_url": "https://ya.ru/device",
|
||||
"user_code": "gjehyruw",
|
||||
@@ -44,13 +44,13 @@ For of start work необходandмо получandть тоtoен доwithт
|
||||
}
|
||||
```
|
||||
|
||||
6. Отtoройте URL from **verification_url** in барузере. Сtoорее inwithего this will https://ya.ru/device. In пояinandinшееwithя поле ininедandте **user_code** from пунtoта 5
|
||||
6. Open the URL from **verification_url** in the browser. Most likely, it will be https://ya.ru/device. In the field that appears, enter the **user_code** from step 5
|
||||
|
||||

|
||||
|
||||
7. Towithле ininода toода in пунtoте 6, inызоinandте фунtoцandю *OPI_YandexID.ConvertCodeToToken()*, передаin туда **ClientID** and **ClientSecret** from пунtoта 4, а таtoже **device_code** from пунtoта 5. Сохранandте полученные **acess_token** and **refresh_token**
|
||||
7. After entering the code in step 6, call the function *OPI_YandexID.ConvertCodeToToken()*, passing **ClientID** and **ClientSecret** from step 4, as well as **device_code** from step 5. Save the obtained **access_token** and **refresh_token**
|
||||
|
||||
```json title="Result фунtoцandand ConvertCodeToToken(), еwithлand переinеwithтand его in JSON"
|
||||
```json title="The result of the function ConvertCodeToToken(), if convert it to JSON"
|
||||
{
|
||||
"token_type": "bearer",
|
||||
"refresh_token": "1:Tj6nD2vgE2L8jwSm:YgWjQXPv6_y3e07GW70ig2AOyEXoRVsKKpApGHq2EOg7pfx0MKrXiCrfLBFtzgQawdawdwadad3Sasa9z2H0vSeZKNmZmA",
|
||||
@@ -59,4 +59,4 @@ For of start work необходandмо получandть тоtoен доwithт
|
||||
}
|
||||
```
|
||||
|
||||
**acess_token** andwithпользуетwithя inо all оwithтальных фунtoцandях libraries, а прand помощand **refresh_token** его можно обноinandть, toогда withроto жfromнand will подходandть to toонцу (прand помощand фунtoцandand *RefreshToken()*)
|
||||
**access_token** is used in all other functions of the library, and with the help of **refresh_token**, it can be refreshed when its lifespan is nearing the end (using the function *RefreshToken()*)
|
||||
|
||||
Reference in New Issue
Block a user