ActivateConnection
This operation activates a Connection after you complete the OAuth authorization flow by clicking the authorization link in the Connection status. This applies to third-party code hosting platforms that use OAuth authorization, such as GitHub, Gitee, and Codeup.
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 object. |
demo-name |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The activation payload. |
|
| account | GitAccount |
No |
The account on the third-party code hosting platform. |
|
| credential | OAuthCredential |
No |
The credential obtained through OAuth authorization that grants API access to the third-party code hosting platform. |
Response elements
|
Element |
Type |
Description |
Example |
| Connection |
The activated Connection object. |
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.