sondaggi

aggiornato
Cover image for: sondaggi

Una risorsa sondaggio contiene informazioni su una richiesta specifica di dati. Una volta creato un sondaggio, verrà avviata la creazione di una o più attività per completare la richiesta.

attributi

nome genere descrizione
id poll ID Resource identifier.
resource string, always poll Resource type specifier.
organisation organisation ID The organisation associated with this resource.
key key ID The key associated with this resource.
user user ID The user associated with this resource.
source source ID The source the poll is targeting. This can be a child source of the session's source.
session session ID The session the poll is using.
subscription optional subscription ID The associated subscription object ID, if applicable.
tasks_pending list of task IDs The tasks associated with the poll that are awaiting processing.
tasks_processing list of task IDs The tasks associated with the poll that are being processed.
tasks_succeeded list of task IDs The tasks associated with the poll that have succeeded.
tasks_failed list of task IDs The tasks associated with the poll that have failed.
tasks_suspended list of task IDs The tasks associated with the poll that are suspended.
results list object containing result objects List of result objects generated by the poll's tasks.
errors list object containing error objects List of error objects generated by the poll's tasks.
state string One of: pending, processing, completed.
date_created datetime When the resource was created.
date_started optional datetime When processing of the poll began.
date_completed optional datetime When processing of the poll finished.

Compiti

Il ruolo più importante della risorsa sondaggio è quello di riflettere l'avanzamento delle attività associate e consentire all'utente finale di iniziare a recuperare i risultati da questi non appena diventano disponibili. Pertanto, la risorsa di polling espone gli attributi relativi alle attività in cui le attività associate sono classificate in base al loro stato.

risultati

Tutti i risultati pubblicati dalle attività in esecuzione nel sondaggio vengono visualizzati nell'attributo dei results del sondaggio. Ciò consente il consumo dei risultati prima del completamento del sondaggio.

Errori

Tutti gli errori generati dalle attività in esecuzione nel sondaggio verranno visualizzati nell'attributo errors del sondaggio.

stati

Lo stato di un sondaggio riflette solo se il sondaggio è in attesa di inizializzazione (in pending ), è in corso ( processing ), o tutte le attività hanno terminato l'esecuzione ( completed ).

Un sondaggio non riflette nessuno stato di errore se non attraverso i suoi compiti associati.

Carico utile

Il payload del sondaggio indica quali tipi di informazioni, tipi di dati e file devono funzionare per il recupero. Lo schema dell'attributo del payload del poll è descritto di seguito.

nome genere descrizione
info_types list of info_type objects Specifies which info types should be retrieved. Supports wildcard *.
data_types list of data_type objects Specifies which data types should be retrieved.
files list of file IDs. Specifies which files to retrieve.
filters nested filters object Specifies which filters to apply to retrieved data.

Ad esempio, il payload del sondaggio per recuperare tutti i tipi di informazioni su un'origine dell'account iCloud sarebbe:

{
  "info_types": ["*"]
}

Per recuperare una varietà di dati di messaggistica da una copia di backup iCloud o Reincubate Relay, ma solo da una determinata data:

{
  "data_types": ["ios_messages.messages", "whatsapp.messages", "viber.messages"],
  "filters": {
    "since": "2019-09-15T22:04:12Z",
    "until": "2021-06-02T12:00:00Z"
  }
}

Per recuperare i dati dei file per le immagini a cui fa riferimento un risultato della Libreria foto iCloud:

{
  "files": ["icpl://xyz123", "icpl://abc321"]
}

I diversi attributi possono anche essere usati contemporaneamente:

{
  "info_types": ["*"],
  "data_types": ["ios_phone.calls"]
}

Filters

Filters allow the client to reduce the amount of data returned to only that which is likely to be of interest. For example, you might filter a poll for SMS data to only the last month of data.

name type description
since optional datetime Filter to only data that was created after this datetime.
until optional datetime Filter to only data that was created before this datetime.

Filters in subscription poll payloads

When using subscriptions to generate regular polls, any filters set in the poll payload will only be used on the initial poll of the subscription. Thereafter, the API will do the following:

  • Any value for until is ignored as to avoid simply re-polling the same interval repeatedly
  • If until was set, the next poll will fetch data from that point in time forward
  • If until was not set, the next poll will fetch data from the time of the initial poll forward (i.e. the API will poll progressively as normal)

Crea POST /polls

Crea un sondaggio per i dati rispetto a una sessione specifica.

Il parametro source deve essere utilizzato solo quando si sceglie come target un'origine figlio dell'origine principale della sessione. Ad esempio, se si recuperano dati da una source rirelay.source il parametro source dovrebbe essere l'ID di quella sorgente.

nome genere descrizione
key optional, key ID Optionally override the key used for this poll. This is useful when letting users trial new functionality.
source optional, source ID Optionally target a child source of the session-linked source.
session session ID The session to be used to authenticate data retrieval.
subscription subscription ID The subscription to use to perform the poll. If this is provided, source and session can be omitted.
payload nested poll payload The poll payload used to specify poll

Utilizzando cURL

curl https://ricloud-api.reincubate.com/polls \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "session": "<session ID>",
  "payload": {
    "info_types": ["*"]
  }
}'

Usando ricloud-py

import ricloud

poll_payload = {
  'info_types': ['*'],
}

poll = ricloud.Poll.create(
  session='<session ID or ricloud.Session instance>',
  payload=poll_payload,
)

Risposta del campione

{
  "id": "54554389-5f1a-4ccf-9bb8-024a031cf948",
  "resource": "poll",
  "organisation": 1,
  "key": 1,
  "user": 1,
  "source": 1,
  "session": "f5a7a7ef-ff21-47fe-9aa6-7ebd08123623",
  "subscription": null,
  "tasks_pending": [],
  "tasks_processing": [],
  "tasks_succeeded": [],
  "tasks_failed": [],
  "tasks_suspended": [],
  "results": {
      "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/polls/54554389-5f1a-4ccf-9bb8-024a031cf948/results"
  },
  "errors": {
    "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/polls/54554389-5f1a-4ccf-9bb8-024a031cf948/errors"
  },
  "state": "pending",
  "date_created": "2020-02-20T11:59:14.694337Z",
  "date_started": null,
  "date_completed": null
}

Recupera GET /polls/{poll ID}

Utilizzando cURL

curl https://ricloud-api.reincubate.com/polls/<poll ID> \
  -H 'Authorization: Token <your key_token>'

Usando ricloud-py

import ricloud

poll = ricloud.Poll.retrieve(<poll ID>)

Elenca GET /polls

nome genere descrizione
key key ID Filter by associated key. This is the key used by the user at the time.
user user ID Filter by associated user.
source source ID Filter by the target source.
session session ID Filter by the target session.
subscription subscription ID Filter by the associated subscription.
state string Filter by session state.
date_created datetime filter Filter by when the resource was created.
date_started datetime filter Filter by when the poll started.
date_completed datetime filter Filter by when the poll was finished.

Utilizzando cURL

curl https://ricloud-api.reincubate.com/polls \
  -H 'Authorization: Token <your key_token>'

Usando ricloud-py

import ricloud

polls = ricloud.Poll.list()

changelog

2022-07-08

  • Support for the until filter in poll payloads was added for SMS extraction. This complements the since filter to allow clients to specify an exact datetime range to retrieve data from.

2020/05/05

  • L'attributo errors stato aggiunto all'oggetto poll. Questo è un oggetto elenco nidificato contenente oggetti di errore associati al sondaggio.

2020/02/20

  • Maggiore : l'attributo dei results dell'oggetto sondaggio è ora un oggetto elenco nidificato, anziché un semplice attributo elenco. Ciò consente di impaginare i risultati quando un sondaggio pubblica un numero elevato di risultati.

2019/10/16

  • Aggiunge l'attributo di subscription all'oggetto sondaggio per indicare se il sondaggio è stato attivato da una sottoscrizione.

2019/06/01

  • L'attributo payload dell'oggetto poll può ora essere composto da più tipi di operazioni. Ciò significa che è possibile creare un sondaggio con uno o tutti info-types di info-types data-types e files nel payload.
  • Maggiore L'attributo type sull'oggetto poll è deprecato a favore dei payload di poll componibili.

Come possiamo aiutare?

Il nostro team di supporto è qui per aiutarti!

I nostri orari di ufficio sono dal lunedì al venerdì, dalle 9:00 alle 17:00 GMT. L'ora è attualmente 7:09 PM GMT.

Miriamo a rispondere a tutti i messaggi entro un giorno lavorativo.

Il nostro fantastico team di supporto

© 2008 - 2023 Reincubate Ltd. Tutti i diritti riservati. Registrato in Inghilterra e Galles #5189175, VAT GB151788978. Reincubate® e Camo® sono marchi registrati. Politica sulla riservatezza & condizioni. Costruito con a Londra.