Tham chiếu API

Tags

Thẻ được phạm vi hóa theo DataType (images, audio, video, files, contacts, SMS, calls, notes). Quản lý thẻ và phân công mục tại đây.

Định nghĩa kiểu

bash
type Tag {
  id: ID!
  name: String!
  count: Int!   # total items carrying this tag
}

type TagRelation {
  tagId: ID!
  key: String!  # id of the tagged item
}

# DataType scopes which content type a tag belongs to
enum DataType {
  AUDIO VIDEO IMAGE SMS CONTACT NOTE FEED_ENTRY CALL DOC PACKAGE FILE
}

# Identifies a single item by its ID key, used in updateTagRelations
input TagRelationStub {
  key: String!
}

Thao tác

query

tags

Liệt kê tất cả thẻ cho kiểu dữ liệu đã cho.

bash
query GetTags($type: DataType!) {
  tags(type: $type) { id name count }
}
query

tagRelations

Tra cứu phân công thẻ cho một tập hợp khóa mục (ví dụ media IDs, note IDs) trong một kiểu dữ liệu.

bash
query GetTagRelations($type: DataType!, $keys: [String!]!) {
  tagRelations(type: $type, keys: $keys) {
    tagId
    key
  }
}
mutation

createTag

Tạo một thẻ mới được phạm vi hóa theo một kiểu dữ liệu.

bash
mutation CreateTag($type: DataType!, $name: String!) {
  createTag(type: $type, name: $name) { id name count }
}
mutation

updateTag

Đổi tên một thẻ hiện có.

bash
mutation UpdateTag($id: ID!, $name: String!) {
  updateTag(id: $id, name: $name) { id name }
}
mutation

deleteTag

Xóa một thẻ và loại bỏ nó khỏi tất cả các mục được gắn thẻ.

bash
mutation DeleteTag($id: ID!) {
  deleteTag(id: $id)
}
mutation

addToTags

Thêm tất cả các mục khớp với một query vào một hoặc nhiều thẻ.

bash
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  addToTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

updateTagRelations

Thêm và/hoặc xóa thẻ trên một mục duy nhất trong một lần gọi.

bash
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
  updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}
mutation

removeFromTags

Xóa tất cả các mục khớp với một query khỏi một hoặc nhiều thẻ.

bash
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}