ActivateConnection
This operation activates a connection. After a user completes the OAuth authorization flow, the development platform activates the specified connection. Third-party code hosting platforms such as GitHub, Gitee, and Codeup use this authorization method.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
devs:ActivateConnection |
update |
*All Resource
|
None | None |
Request syntax
PATCH /2023-07-14/connections/{name}/activate HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| name |
string |
No |
The name of the connection. |
demo-name |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The information required to activate the connection. |
|
| account | GitAccount |
No |
The account information on the code hosting platform. |
|
| credential | OAuthCredential |
No |
The credential obtained from the OAuth authorization flow. It grants access to the code hosting platform's APIs. |
Response elements
|
Element |
Type |
Description |
Example |
| Connection |
The activated connection. |
Examples
Success response
JSON format
{
"uid": "1455541096***548",
"kind": "Connection",
"createdTime": "2021-11-19T09:34:38Z",
"name": "my-connection",
"spec": {
"platform": "github",
"account": {
"name": "your_username",
"displayName": "your_displayname",
"id": "1",
"avatar": "https://gitee.com/assets/no_portrait.png",
"uri": "https://gitlab.com"
},
"gitlabConfig": {
"isFixedIP": true,
"uri": "http://gitlab.c16194660f14898a0810408171302ac.cn-shanghai.alicontainer.com/",
"token": "your-token"
}
},
"labels": {
"key": "key=value"
},
"description": "test-description",
"status": {
"installation": {
"stage": "finished",
"message": "Please click 'actionUri' to complete the OAuth authorization process",
"actionUri": "https://github.com/login/oauth/authorize?client_id=86059a1b2bb20d3e5fc3&scope=repo,repo:status,delete_repo"
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.