Tham chiếu API
Thẻ
Kiểm tra app.capabilities để biết tính năng và app.access cùng quyền máy chủ để xác định quyền truy cập. Thay giá trị mẫu trước khi gọi.
Định nghĩa kiểu
graphql
type Mutation {
addToTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
createTag(type: DataType!, name: String!): Tag!
deleteTag(id: ID!): Boolean!
removeFromTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
updateTag(id: ID!, name: String!): Tag!
updateTagRelations(type: DataType!, keys: [String!]!, addTagIds: [ID!]!, removeTagIds: [ID!]!): Boolean!
}
type Query {
tagKeys(id: ID!): [String!]!
tagRelations(type: DataType!, keys: [String!]!): [TagRelation!]!
tags(type: DataType!): [Tag!]!
}
enum DataType {
DEFAULT
AUDIO
VIDEO
IMAGE
SMS
CONTACT
NOTE
FEED_ENTRY
CALL
PACKAGE
FILE
APP_FILE
DOC
}
type Tag {
id: ID!
name: String!
type: DataType!
count: Int!
}
type TagRelation {
tagId: ID!
key: String!
}Thao tác
mutation
createTag
Tạo thẻ mới trong phạm vi một loại dữ liệu.
graphql
mutation createTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name type count }
}mutation
deleteTag
Xóa thẻ và gỡ nó khỏi mọi mục đã gắn.
graphql
mutation deleteTag($id: ID!) {
deleteTag(id: $id)
}mutation
updateTag
Đổi tên thẻ hiện có.
graphql
mutation updateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name type count }
}mutation
updateTagRelations
Thêm và/hoặc gỡ thẻ của một mục trong một lần gọi.
graphql
mutation updateTagRelations($type: DataType!, $keys: [String!]!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, keys: $keys, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}query
tagKeys
Liệt kê khóa mục liên kết với thẻ đã chỉ định.
graphql
query tagKeys($id: ID!) {
tagKeys(id: $id)
}query
tagRelations
Tra việc gán thẻ cho một tập khóa mục (ví dụ ID phương tiện, ID ghi chú) trong một loại dữ liệu.
graphql
query tagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) { tagId key }
}