GetRepository - Queries a code repository

Updated at:

Queries the details of a single code repository through OpenAPI.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Get the endpoint to replace {domain} in the request syntax.
  • Get a personal access token.
  • Get the organization ID. This parameter is required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.

Product

Resource

Required permission

Codeup

Code repository

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}

Region edition

GET https://{domain}/oapi/v1/codeup/repositories/{repositoryId}

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The repository ID or the URL-encoded full path.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

object

accessLevel

string

The permission level of the current user on the repository. Valid values: [20 30 40].

40

adminSettingLanguage

string

The primary programming language of the repository.

Java

allowPush

boolean

Indicates whether push is allowed.

true

archived

boolean

Indicates whether the repository is archived.

false

avatarUrl

string

The URL of the repository avatar.

https://example/example/w/100/h/100

cloneDownloadControlGray

boolean

The organization-level gray release switch for clone/download control.

false

createdAt

string

The creation time.

2024-10-05T15:30:45Z

creatorId

integer

The user ID of the creator.

No actual business meaning

creatorUid

string

The creator of the repository (Yunxiao user ID).

5f8b3b3b3b3b3b3b3b3b3b3b

defaultBranch

string

The default branch of the repository.

master

demoProject

boolean

Indicates whether the repository is a demo repository.

false

description

string

The description of the repository.

The description of the repository

enableCloneDownloadControl

boolean

Indicates whether clone and download control is enabled.

false

forkCount

integer

The number of forks.

1

httpUrlToRepo

string

The HTTP URL.

https://example.com/example_org/example.git

id

integer

The repository ID.

1

lastActivityAt

string

The last activity time.

2024-10-05T15:30:45Z

name

string

The name of the repository.

demo-repo

nameWithNamespace

string

The full name of the repository (including the full group name).

60de7a6852743a5162b5f957 / DemoRepo

namespace

object

avatar

string

The URL of the avatar.

https://example/example/w/100/h/100

createdAt

string

The creation time.

2024-10-05T15:30:45Z

description

string

The description.

Description content

id

integer

The ID.

1

name

string

The name.

demo-namespace

ownerId

integer

The owner ID.

No actual business meaning

path

string

The path.

demo-namespace

updatedAt

string

The update time.

2024-10-05T15:30:45Z

visibility

string

The visibility: private, internal (public within the organization). Valid values: [private internal].

private

openCloneDownloadControl

boolean

Indicates whether clone and download control is enabled.

false

owner

object

avatarUrl

string

The URL of the user avatar.

https://example/example/w/100/h/100

email

string

The email address of the user.

username@example.com

id

integer

The primary key ID with no business meaning.

1

name

string

The name of the user.

codeup-name

state

string

The state of the user. Valid values: {active, blocked}.

active

userId

string

The Yunxiao user ID.

62c795xxxb468af8

username

string

The logon name of the user.

codeup-username

webUrl

string

The web access URL.

xxx

path

string

The path of the repository.

demo-repo

pathWithNamespace

string

The full path of the repository (including the full group path).

60de7a6852743a5162b5f957/DemoRepo

permissions

object

The permission summary.

groupAccess

object

accessLevel

integer

The group permission. Valid values: {20-Viewer, 30-Developer, 40-Admin}.

30

notificationLevel

integer

Reserved information.

xxx

projectAccess

object

accessLevel

integer

The repository permission. Valid values: {20-Viewer, 30-Developer, 40-Admin}.

30

notificationLevel

integer

Reserved information.

xxx

projectType

integer

The repository type. Empty or 0 by default.

0

repositoryTags

array

The list of repository tags.

-

object

The repository tag.

tagColor

string

The color of the tag.

#C4C6CF

tagName

string

The name of the tag.

Tag1

sshUrlToRepo

string

The SSH clone URL of the repository.

git@example:example_org/example.git

starCount

integer

The number of stars.

1

updatedAt

string

The update time.

2024-10-05T15:30:45Z

visibility

string

The visibility: private, internal (public within the organization). Valid values: [private internal].

private

webUrl

string

The URL for web access.

https://example.com/example/example_demo

Response example

{
    "accessLevel": "40",
    "adminSettingLanguage": "Java",
    "allowPush": true,
    "archived": false,
    "avatarUrl": "https://example/example/w/100/h/100",
    "cloneDownloadControlGray": false,
    "createdAt": "2024-10-05T15:30:45Z",
    "creatorId": No actual business meaning,
    "creatorUid": "5f8b3b3b3b3b3b3b3b3b3b3b",
    "defaultBranch": "master",
    "demoProject": false,
    "description": "The description of the repository",
    "enableCloneDownloadControl": false,
    "forkCount": 1,
    "httpUrlToRepo": "https://example.com/example_org/example.git",
    "id": 1,
    "lastActivityAt": "2024-10-05T15:30:45Z",
    "name": "demo-repo",
    "nameWithNamespace": "60de7a6852743a5162b5f957 / DemoRepo",
    "namespace": {
        "avatar": "https://example/example/w/100/h/100",
        "createdAt": "2024-10-05T15:30:45Z",
        "description": "Description content",
        "id": 1,
        "name": "demo-namespace",
        "ownerId": No actual business meaning,
        "path": "demo-namespace",
        "updatedAt": "2024-10-05T15:30:45Z",
        "visibility": "private"
    },
    "openCloneDownloadControl": false,
    "owner": {
        "avatarUrl": "https://example/example/w/100/h/100",
        "email": "username@example.com",
        "id": 1,
        "name": "codeup-name",
        "state": "active",
        "userId": "62c795xxxb468af8",
        "username": "codeup-username",
        "webUrl": "xxx"
    },
    "path": "demo-repo",
    "pathWithNamespace": "60de7a6852743a5162b5f957/DemoRepo",
    "permissions": {
        "groupAccess": {
            "accessLevel": 30,
            "notificationLevel": xxx
        },
        "projectAccess": {
            "accessLevel": 30,
            "notificationLevel": xxx
        }
    },
    "projectType": 0,
    "repositoryTags": [
        {
            "tagColor": "#C4C6CF",
            "tagName": "Tag1"
        }
    ],
    "sshUrlToRepo": "git@example:example_org/example.git",
    "starCount": 1,
    "updatedAt": "2024-10-05T15:30:45Z",
    "visibility": "private",
    "webUrl": "https://example.com/example/example_demo"
}

Error codes

For more information about API error codes, see the Error Code Center.