이벤트 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

필터 매개변수

액션

action 매개변수에 대한 사용 가능한 유형은 사용자 기여 이벤트에서 확인하세요.
이 옵션은 모두 소문자입니다.

대상 유형

target_type 매개변수에 대한 사용 가능한 대상 유형은 다음과 같습니다:

이 옵션은 모두 소문자입니다.
자식 항목, 연결된 항목, 시작일, 마감일 및 건강 상태와 같은 일부 에픽 기능은 API를 사용하여 사용할 수 없습니다.
일부 병합 요청에 대한 논의는 DiscussionNote 유형일 수 있습니다. 이는 API를 사용하여 사용할 수 없습니다.

날짜 형식

beforeafter 매개변수에 대한 날짜는 다음 형식으로 제공해야 합니다:

YYYY-MM-DD

이벤트 시간 기간 제한

GitLab은 성능 이유로 이벤트 테이블에서 3년 이상 된 이벤트를 제거합니다.

현재 인증된 사용자의 이벤트 목록

인증된 사용자의 이벤트 목록을 가져옵니다. read_user 또는 api 범위가 필요합니다.
에픽과 관련된 이벤트는 API를 사용하여 사용할 수 없습니다.

GET /events

매개변수:

속성 유형 필수 설명
action string 아니오 특정 액션 유형의 이벤트만 포함합니다.
target_type string 아니오 특정 대상 유형의 이벤트만 포함합니다.
before date 아니오 특정 날짜 이전에 생성된 이벤트만 포함합니다. 날짜 형식 보기.
after date 아니오 특정 날짜 이후에 생성된 이벤트만 포함합니다. 날짜 형식 보기.
scope string 아니오 사용자의 프로젝트 전반에 걸쳐 모든 이벤트를 포함합니다.
sort string 아니오 created_at을 기준으로 이벤트를 asc 또는 desc 순서로 정렬합니다. 기본값은 desc입니다.

예제 요청:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/events?target_type=issue&action=created&after=2017-01-31&before=2017-03-01&scope=all"

예제 응답:

[
  {
    "id": 1,
    "title":null,
    "project_id":1,
    "action_name":"opened",
    "target_id":160,
    "target_iid":53,
    "target_type":"Issue",
    "author_id":25,
    "target_title":"Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.",
    "created_at":"2017-02-09T10:43:19.667Z",
    "author":{
      "name":"User 3",
      "username":"user3",
      "id":25,
      "state":"active",
      "avatar_url":"http://www.gravatar.com/avatar/97d6d9441ff85fdc730e02a6068d267b?s=80\u0026d=identicon",
      "web_url":"https://gitlab.example.com/user3"
    },
    "author_username":"user3",
    "imported":false,
    "imported_from": "none"
  },
  {
    "id": 2,
    "title":null,
    "project_id":1,
    "action_name":"opened",
    "target_id":159,
    "target_iid":14,
    "target_type":"Issue",
    "author_id":21,
    "target_title":"Nostrum enim non et sed optio illo deleniti non.",
    "created_at":"2017-02-09T10:43:19.426Z",
    "author":{
      "name":"Test User",
      "username":"ted",
      "id":21,
      "state":"active",
      "avatar_url":"http://www.gravatar.com/avatar/80fb888c9a48b9a3f87477214acaa63f?s=80\u0026d=identicon",
      "web_url":"https://gitlab.example.com/ted"
    },
    "author_username":"ted",
    "imported":false,
    "imported_from": "none"
  }
]

사용자 기여 이벤트 가져오기

지정된 사용자의 기여 이벤트를 가장 최근 것부터 오래된 것 순으로 가져옵니다. read_user 또는 api 범위가 필요합니다.

API를 사용하여 에픽과 관련된 이벤트는 사용할 수 없습니다.

GET /users/:id/events

매개변수:

속성 유형 필수 설명
id 정수 사용자 ID 또는 사용자 이름
action 문자열 아니오 특정 작업 유형의 이벤트만 포함
target_type 문자열 아니오 특정 대상 유형의 이벤트만 포함
before 날짜 아니오 특정 날짜 이전에 생성된 이벤트만 포함. 날짜 형식 지정 방법 보기.
after 날짜 아니오 특정 날짜 이후에 생성된 이벤트만 포함. 날짜 형식 지정 방법 보기.
sort 문자열 아니오 created_at에 의해 이벤트를 asc 또는 desc 순서로 정렬합니다. 기본값은 desc입니다.
page 정수 아니오 반환할 결과의 페이지입니다. 기본값은 1입니다.
per_page 정수 아니오 페이지당 결과 수입니다. 기본값은 20입니다.
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/:id/events"

예시 응답:

[
  {
    "id": 3,
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 830,
    "target_iid": 82,
    "target_type": "Issue",
    "author_id": 1,
    "target_title": "Public project search field",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
      "web_url": "http://localhost:3000/root"
    },
    "author_username": "root",
    "imported": false,
    "imported_from": "none"
  },
  {
    "id": 4,
    "title": null,
    "project_id": 15,
    "action_name": "pushed",
    "target_id": null,
    "target_iid": null,
    "target_type": null,
    "author_id": 1,
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
      "web_url": "http://localhost:3000/root"
    },
    "author_username": "john",
    "imported": false,
    "imported_from": "none",
    "push_data": {
      "commit_count": 1,
      "action": "pushed",
      "ref_type": "branch",
      "commit_from": "50d4420237a9de7be1304607147aec22e4a14af7",
      "commit_to": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
      "ref": "main",
      "commit_title": "Add simple search to projects in public area"
    },
    "target_title": null
  },
  {
    "id": 5,
    "title": null,
    "project_id": 15,
    "action_name": "closed",
    "target_id": 840,
    "target_iid": 11,
    "target_type": "Issue",
    "author_id": 1,
    "target_title": "Finish & merge Code search PR",
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
      "web_url": "http://localhost:3000/root"
    },
    "author_username": "root",
    "imported": false,
    "imported_from": "none"
  },
  {
    "id": 7,
    "title": null,
    "project_id": 15,
    "action_name": "commented on",
    "target_id": 1312,
    "target_iid": 61,
    "target_type": "Note",
    "author_id": 1,
    "target_title": null,
    "created_at": "2015-12-04T10:33:58.089Z",
    "note": {
      "id": 1312,
      "body": "What an awesome day!",
      "attachment": null,
      "author": {
        "name": "Dmitriy Zaporozhets",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
        "web_url": "http://localhost:3000/root"
      },
      "created_at": "2015-12-04T10:33:56.698Z",
      "system": false,
      "noteable_id": 377,
      "noteable_type": "Issue"
    },
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png",
      "web_url": "http://localhost:3000/root"
    },
    "author_username": "root",
    "imported": false,
    "imported_from": "none"
  }
]

프로젝트의 공개 이벤트 목록

note
이 엔드포인트는 다른 엔드포인트보다 오래되었습니다. 문서는 이전에 Projects API 페이지에 위치해 있었습니다.

특정 프로젝트의 공개 이벤트 목록을 가져옵니다.

GET /projects/:project_id/events

Parameters:

속성 유형 필요 여부 설명
project_id 정수/문자열 프로젝트의 ID 또는 URL 인코딩된 경로
action 문자열 아니오 특정 액션 유형의 이벤트만 포함
target_type 문자열 아니오 특정 대상 유형의 이벤트만 포함
before 날짜 아니오 특정 날짜 이전에 생성된 이벤트만 포함. 날짜 형식 지정 방법 보기.
after 날짜 아니오 특정 날짜 이후에 생성된 이벤트만 포함. 날짜 형식 지정 방법 보기.
sort 문자열 아니오 created_at에 따라 이벤트를 asc 또는 desc 순서로 정렬합니다. 기본값은 desc입니다.

예시 요청:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:project_id/events?target_type=issue&action=created&after=2017-01-31&before=2017-03-01"

예시 응답:

[
  {
    "id": 8,
    "title": null,
    "project_id": 1,
    "action_name": "opened",
    "target_id": 160,
    "target_iid": 160,
    "target_type": "Issue",
    "author_id": 25,
    "target_title": "Qui natus eos odio tempore et quaerat consequuntur ducimus cupiditate quis.",
    "created_at": "2017-02-09T10:43:19.667Z",
    "author": {
      "name": "User 3",
      "username": "user3",
      "id": 25,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/97d6d9441ff85fdc730e02a6068d267b?s=80\u0026d=identicon",
      "web_url": "https://gitlab.example.com/user3"
    },
    "author_username": "user3",
    "imported": false,
    "imported_from": "none"
  },
  {
    "id": 9,
    "title": null,
    "project_id": 1,
    "action_name": "opened",
    "target_id": 159,
    "target_iid": 159,
    "target_type": "Issue",
    "author_id": 21,
    "target_title": "Nostrum enim non et sed optio illo deleniti non.",
    "created_at": "2017-02-09T10:43:19.426Z",
    "author": {
      "name": "Test User",
      "username": "ted",
      "id": 21,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/80fb888c9a48b9a3f87477214acaa63f?s=80\u0026d=identicon",
      "web_url": "https://gitlab.example.com/ted"
    },
    "author_username": "ted",
    "imported": false,
    "imported_from": "none"
  },
  {
    "id": 10,
    "title": null,
    "project_id": 1,
    "action_name": "commented on",
    "target_id": 1312,
    "target_iid": 1312,
    "target_type": "Note",
    "author_id": 1,
    "data": null,
    "target_title": null,
    "created_at": "2015-12-04T10:33:58.089Z",
    "note": {
      "id": 1312,
      "body": "What an awesome day!",
      "attachment": null,
      "author": {
        "name": "Dmitriy Zaporozhets",
        "username": "root",
        "id": 1,
        "state": "active",
        "avatar_url": "https://gitlab.example.com/uploads/user/avatar/1/fox_avatar.png",
        "web_url": "https://gitlab.example.com/root"
      },
      "created_at": "2015-12-04T10:33:56.698Z",
      "system": false,
      "noteable_id": 377,
      "noteable_type": "Issue",
      "noteable_iid": 377
    },
    "author": {
      "name": "Dmitriy Zaporozhets",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "https://gitlab.example.com/uploads/user/avatar/1/fox_avatar.png",
      "web_url": "https://gitlab.example.com/root"
    },
    "author_username": "root",
    "imported": false,
    "imported_from": "none"
  }
]