Set up Google Drive authorized account
1. API Description
This API is used to set up a Google Drive authorized account.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/general/update-auto-backup-server
- V2.5.0 and below: POST [ip]/mwapi/update-auto-backup-server
Administrator Rights | Logged-in |
---|---|
No | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
inUse | No | Int | Whether the account is enabled. Currently, only one account is supported. Default is "1: Enabled". |
accountId | Yes | String | The ID of the authorized account in Google Drive. |
userName | Yes | String | The nickname of the user after Google Drive authorization. |
photoPath | Yes | String | The user avatar after Google Drive authorization. |
accessToken | Yes | String | The access token after Google Drive authorization. |
refreshToken | Yes | String | The refresh token after Google Drive authorization. |
dirName | No | String | The upload directory after Google Drive authorization. Currently not supported. |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
4. Example
Set up a Google Drive authorized account.
Input Example
{
"inUse":1,
"accountId":"115575044591555733090",
"userName":"junyi zhang",
"photoPath":"https://lh3.googleusercontent.com/a/ALm5wu0Pln7FioQUACaDOD7XlfL8Fuw62-FK_DttJVZG=s96-c",
"accessToken":"ya29.a0Aa4xrXM88AfaUuTRFQMNaB55EQ0OApS8yCDxxQfnvkzbCP9_Tu7TAbRUdWGuD73G8ro1TVMT51v0x3E9pxoTADeCIHLWTI-HXB2ZnvmY4NgzJ6friaV9NrbLn7CIXI5TPaejwHvGGT9lc6hOz0KRcA8NlfLFaCgYKATASARMSFQEjDvL9nX84AAsOjhFdLCSuoNTOdg0163",
"refreshToken":"1//06XDuRKlWs6_QCgYIARAAGAYSNwF-L9IrerRiMSl1Dh1ItMJyCfYjsehhmK38z-6T0d-cDX9Z6mUd1mztXEDX4RQunTzDklYCFSA",
"dirName":"",
}
Output Example
{
"status": 0,
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Status | Definition | Description |
---|---|---|
49 | MW_STATUS_INVALID_DATA | The parameters are missing or incorrect |