Help Center/ CodeArts Repo/ API Reference/ Historical APIs/ Adding a Hook to a Specified Repository/ Obtaining the List of Public Sample Templates (Deprecated)
Updated on 2026-01-27 GMT+08:00

Obtaining the List of Public Sample Templates (Deprecated)

Function

This API is used to obtain the list of public sample templates.

This API has been deprecated. Use the API described in Template Repository List.

URI

GET /v2/repositories/repository-templates

Table 1 Query parameters

Parameter

Mandatory

Type

Description

platform

No

String

Template platform type.

language

No

String

Language.

pipeline

No

String

Whether pipelines are supported.

enter_type

No

String

Template category.

search

No

String

Template name.

date_order

No

String

Templates date order.

used_time_order

No

String

Template reference time.

type

No

String

Template visibility.

region

No

String

Region name.

page_no

Yes

Integer

Page number.

page_size

Yes

Integer

Number of data records on each page.

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

Mandatory

Range

1–100,000 characters.

Default value

None.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

TemplateRepositoryList object

Response result.

status

String

Explanation

Response status.

Range

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message.

Table 5 TemplateRepositoryList

Parameter

Type

Description

projects

Array of TemplateRepository objects

Template list.

total

Integer

Total number of templates.

Table 6 TemplateRepository

Parameter

Type

Description

id

Integer

Template unique ID.

name

String

Template name.

template_name

String

Name of the repository associated with the template.

tags

Array of strings

Template tag.

description

String

Template description.

brief_introduction

String

Template overview.

auto_pending_pipelines

Integer

Whether to automatically create a pipeline.

language

String

Template language category.

created_at

String

Template creation time.

used_times

Integer

Template reference time.

liked_times

Integer

Likes.

creator_name

String

Template creator.

https_url

String

Template HTTPS link.

Example Requests

GET https://{endpoint}/v2/repositories/repository-templates?page_no=1&page_size=10

Example Responses

Status code: 200

OK

{
  "result" : {
    "projects" : [ {
      "id" : 453613,
      "name" : "javaMavenDemo",
      "template_name" : "javaMavenDemo",
      "tags" : [ "UnsupportedPipeline", "OTHERS", "Kunpeng ARM64" ],
      "description" : "javaMavenDemo",
      "brief_introduction" : "javaMavenDemo",
      "auto_pending_pipelines" : 0,
      "language" : "OTHERS",
      "created_at" : "Sep 25, 2019 4:03:31 PM",
      "used_times" : 58,
      "liked_times" : 1,
      "creator_name" : "repo",
      "https_url" : "https://example.com/chentest00001/javaMavenDemo.git"
    } ],
    "total" : 100
  },
  "status" : "success"
}

Status Code

Status Code

Description

200

OK

Error Codes

See Error Codes.