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

Obtain the list of public sample templates.

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

URI

GET /v1/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

entertype

No

String

Template tag

search

No

String

Template name

dateorder

No

String

Sort templates by date

usedtimeorder

No

String

Sort template by reference times

type

No

String

Explanation:

Template visibility

Range:

  • SHARE: personal sample template
  • PUBLIC: public read-only

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

User token.

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

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 template

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

Reference time

liked_times

Integer

Likes

creator_name

String

Template creator

https_url

String

Template HTTPS link

Request Example

GET https://{endpoint}/v1/repositories/repository_templates

Response Example

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" : "Codehub",
      "https_url" : "https://codehub.alpha.devcloud.intest.com/chentest00001/javaMavenDemo.git"
    } ],
    "total" : 100
  },
  "status" : "success"
}

Status Codes

Status Codes

Description

200

OK

Error Codes

See error codes.