Referencia de la API

Notas

Consultar app.capabilities para comprobar la compatibilidad de funciones y app.access junto con los permisos del anfitrión para la autorización. Los ejemplos usan valores sintéticos; sustituir las rutas, ID, entradas y filtros antes de llamar.

Definiciones de tipos

graphql
type Mutation {
  createNote(input: NoteInput!): Note!
  deleteNotes(query: String!): ActionResult!
  restoreNotes(query: String!): ActionResult!
  saveFeedEntriesToNotes(query: String!): [ID!]!
  trashNotes(query: String!): ActionResult!
  updateNote(id: ID!, input: NoteInput!): Note!
}

type Query {
  exportNotes(query: String!): String!
  note(id: ID!): Note
  noteCount(query: String!): Int!
  notes(query: String!, offset: Int!, limit: Int!): [Note!]!
}

type ActionResult {
	affectedCount: Int!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

scalar Instant

type Note {
	id: ID!
	title: String!
	content: String!
	deletedAt: Instant
	createdAt: Instant!
	updatedAt: Instant!
	tags: [Tag!]!
}

input NoteInput {
	title: String!
	content: String!
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

Operaciones

mutation

createNote

Crear y guardar una nota a partir de los datos de entrada indicados.

graphql
mutation createNote($input: NoteInput!) {
  createNote(input: $input) { id title content deletedAt createdAt updatedAt }
}
mutation

deleteNotes

Eliminar permanentemente las notas de la papelera que coincidan con una consulta. Solo afecta a notas que ya estén en la papelera.

graphql
mutation deleteNotes($query: String!) {
  deleteNotes(query: $query) { affectedCount }
}
mutation

restoreNotes

Restaurar las notas de la papelera que coincidan con una consulta.

graphql
mutation restoreNotes($query: String!) {
  restoreNotes(query: $query) { affectedCount }
}
mutation

saveFeedEntriesToNotes

Guardar como notas las entradas de fuentes coincidentes y devolver los ID de las notas creadas.

graphql
mutation saveFeedEntriesToNotes($query: String!) {
  saveFeedEntriesToNotes(query: $query)
}
mutation

trashNotes

Mover a la papelera las notas que coincidan con una consulta.

graphql
mutation trashNotes($query: String!) {
  trashNotes(query: $query) { affectedCount }
}
mutation

updateNote

Actualizar una nota almacenada a partir de los datos de entrada indicados.

graphql
mutation updateNote($id: ID!, $input: NoteInput!) {
  updateNote(id: $id, input: $input) { id title content deletedAt createdAt updatedAt }
}
query

exportNotes

Serializar las notas que coincidan con una consulta (incluidas sus etiquetas) como cadena JSON para copia de seguridad o transferencia.

graphql
query exportNotes($query: String!) {
  exportNotes(query: $query)
}
query

note

Obtener una nota por su ID.

graphql
query note($id: ID!) {
  note(id: $id) { id title content deletedAt createdAt updatedAt }
}
query

noteCount

Contar las notas que coincidan con una consulta.

graphql
query noteCount($query: String!) {
  noteCount(query: $query)
}
query

notes

Buscar notas (título + contenido). Dejar query vacío para listar todas las notas que no estén en la papelera.

graphql
query notes($query: String!, $offset: Int!, $limit: Int!) {
  notes(query: $query, offset: $offset, limit: $limit) { id title content deletedAt createdAt updatedAt }
}