Referência da API

Tags

Tags têm escopo por DataType (imagens, áudio, vídeo, arquivos, contatos, SMS, chamadas, notas). Gerencie tags e atribuições de itens aqui.

Definições de Tipo

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!
}

Operações

query

tags

Liste todas as tags para o tipo de dados fornecido.

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

tagRelations

Consulte atribuições de tag para um conjunto de chaves de item (ex. IDs de mídia, IDs de nota) em um tipo de dados.

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

createTag

Crie uma nova tag com escopo para um tipo de dados.

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

updateTag

Renomeie uma tag existente.

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

deleteTag

Exclua uma tag e a remova de todos os itens marcados.

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

addToTags

Adicione todos os itens correspondentes a uma consulta a uma ou mais tags.

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

updateTagRelations

Adicione e/ou remova tags de um único item em uma única chamada.

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

removeFromTags

Remova todos os itens correspondentes a uma consulta de uma ou mais tags.

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