Riferimento API

Feed (RSS)

Verificare app.capabilities per il supporto delle funzionalità e app.access insieme alle autorizzazioni host per l’autorizzazione. Gli esempi usano valori sintetici; sostituire percorsi, ID, input e filtri prima della chiamata.

Definizioni di tipo

graphql
type Subscription {
  feedsFetched: FeedSyncChange!
}

type Mutation {
  createFeed(url: String!, fetchContent: Boolean!, name: String): Feed!
  deleteFeed(id: ID!): Boolean!
  deleteFeedEntries(query: String!): ActionResult!
  importFeeds(content: String!): Boolean!
  markFeedEntriesRead(query: String!, read: Boolean!): ActionResult!
  syncFeedEntryContent(id: ID!): FeedEntry!
  syncFeeds(id: ID): Boolean!
  updateFeed(id: ID!, name: String, fetchContent: Boolean, url: String): Feed!
}

type Query {
  exportFeeds: String!
  feed(id: ID!): Feed
  feedEntries(query: String!, offset: Int!, limit: Int!): [FeedEntry!]!
  feedEntry(id: ID!): FeedEntry
  feedEntryCount(query: String!): Int!
  feedEntryCounts: [FeedEntryCount!]!
  feedSyncStates: [FeedSyncState!]!
  feeds: [Feed!]!
  fetchFeedTitle(url: String!): String!
}

type ActionResult {
	affectedCount: Int!
}

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

type Feed {
	id: ID!
	name: String!
	url: String!
	fetchContent: Boolean!
	logo: String!
	lastSyncAt: Instant
	lastError: FeedError!
	createdAt: Instant!
	updatedAt: Instant!
}

type FeedEntry {
	id: ID!
	title: String!
	url: String!
	image: String!
	description: String!
	author: String!
	content: String!
	feedId: ID!
	rawId: String!
	read: Boolean!
	publishedAt: Instant!
	createdAt: Instant!
	updatedAt: Instant!
	tags: [Tag!]!
	feed: Feed
}

type FeedEntryCount {
	feedId: ID!
	count: Int!
}

type FeedError {
	code: FeedErrorCode!
	detail: String!
}

enum FeedErrorCode {
	NONE
	TIMEOUT
	SERVER
	DNS
	PARSE
	UNKNOWN
}

type FeedSyncChange {
	feedId: ID!
	error: String
	canceled: Boolean
}

type FeedSyncState {
	feedId: ID!
	taskId: ID!
	revision: Long!
	status: FeedWorkerStatus!
	error: String!
}

enum FeedWorkerStatus {
	QUEUED
	RUNNING
	CANCELED
	COMPLETED
	ERROR
}

scalar Instant

scalar Long

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

Operazioni

subscription

feedsFetched

Ricevere le modifiche di sincronizzazione dei feed.

graphql
subscription feedsFetched {
  feedsFetched { feedId error canceled }
}
mutation

createFeed

Iscriversi a un feed e accodarne la sincronizzazione iniziale.

graphql
mutation createFeed($url: String!, $fetchContent: Boolean!, $name: String) {
  createFeed(url: $url, fetchContent: $fetchContent, name: $name) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
mutation

deleteFeed

Annullare l’iscrizione a un feed ed eliminarne tutti gli articoli (e le relative associazioni ai tag).

graphql
mutation deleteFeed($id: ID!) {
  deleteFeed(id: $id)
}
mutation

deleteFeedEntries

Eliminare gli articoli dei feed corrispondenti a una query (e le relative associazioni ai tag).

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

importFeeds

Importare un documento OPML (come stringa) nel database dei feed.

graphql
mutation importFeeds($content: String!) {
  importFeeds(content: $content)
}
mutation

markFeedEntriesRead

Segnare gli articoli dei feed corrispondenti come letti o non letti e indicare il numero interessato.

graphql
mutation markFeedEntriesRead($query: String!, $read: Boolean!) {
  markFeedEntriesRead(query: $query, read: $read) { affectedCount }
}
mutation

syncFeedEntryContent

Recuperare e salvare il contenuto completo di un articolo di feed.

graphql
mutation syncFeedEntryContent($id: ID!) {
  syncFeedEntryContent(id: $id) { id title url image description author content feedId }
}
mutation

syncFeeds

Accodare la sincronizzazione di un feed tramite ID o di tutti i feed se non viene fornito alcun ID.

graphql
mutation syncFeeds($id: ID) {
  syncFeeds(id: $id)
}
mutation

updateFeed

Aggiornare il nome visualizzato di un feed o il flag fetchContent.

graphql
mutation updateFeed($id: ID!, $name: String, $fetchContent: Boolean, $url: String) {
  updateFeed(id: $id, name: $name, fetchContent: $fetchContent, url: $url) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

exportFeeds

Esportare tutti i feed sottoscritti come stringa OPML.

graphql
query exportFeeds {
  exportFeeds
}
query

feed

Leggere un’iscrizione a un feed tramite ID; restituire null se assente.

graphql
query feed($id: ID!) {
  feed(id: $id) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

feedEntries

Cercare articoli dei feed (titolo + descrizione). Lasciare query vuoto per elencarli tutti.

graphql
query feedEntries($query: String!, $offset: Int!, $limit: Int!) {
  feedEntries(query: $query, offset: $offset, limit: $limit) { id title url image description author content feedId }
}
query

feedEntry

Recuperare un articolo di feed tramite ID.

graphql
query feedEntry($id: ID!) {
  feedEntry(id: $id) { id title url image description author content feedId }
}
query

feedEntryCount

Contare gli articoli dei feed corrispondenti a una query.

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

feedEntryCounts

Leggere i riepiloghi dei conteggi degli articoli dei feed.

graphql
query feedEntryCounts {
  feedEntryCounts { feedId count }
}
query

feedSyncStates

Leggere lo stato corrente di sincronizzazione delle iscrizioni ai feed.

graphql
query feedSyncStates {
  feedSyncStates { feedId taskId revision status error }
}
query

feeds

Elencare tutti i feed sottoscritti.

graphql
query feeds {
  feeds { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

fetchFeedTitle

Recupera il titolo del feed dal suo URL senza aggiungere un abbonamento.

graphql
query fetchFeedTitle($url: String!) {
  fetchFeedTitle(url: $url)
}