Aller au contenu principal

Polls

Publié le 27 juin 2019· Mis à jour le 5 juin 2026

Cover image for: Polls

A poll resource contains information on a specific request for data. Once a poll is created, it will trigger the creation of one or more tasks in order to complete the request.

Attributes

nametypedescription
idpoll IDResource identifier.
resourcestring, always pollResource type specifier.
organisationorganisation IDThe organisation associated with this resource.
keykey IDThe key associated with this resource.
useruser IDThe user associated with this resource.
sourcesource IDThe source the poll is targeting. This can be a child source of the session's source.
sessionsession IDThe session the poll is using.
subscriptionoptional subscription IDThe associated subscription object ID, if applicable.
tasks_pendinglist of task IDsThe tasks associated with the poll that are awaiting processing.
tasks_processinglist of task IDsThe tasks associated with the poll that are being processed.
tasks_succeededlist of task IDsThe tasks associated with the poll that have succeeded.
tasks_failedlist of task IDsThe tasks associated with the poll that have failed.
tasks_suspendedlist of task IDsThe tasks associated with the poll that are suspended.
resultslist object containing result objectsList of result objects generated by the poll's tasks.
errorslist object containing error objectsList of error objects generated by the poll's tasks.
statestringOne of: pending, processing, completed.
date_createddatetimeWhen the resource was created.
date_startedoptional datetimeWhen processing of the poll began.
date_completedoptional datetimeWhen processing of the poll finished.

Tasks

The most important role of the poll resource is to reflect the progress of its associated tasks and allow the end-user to start fetching results from these as soon as they become available. Therefore, the poll resource exposes task related attributes wherein associated tasks are categorised by their state.

Results

Any results published by tasks running within the poll are surfaced in the poll's results attribute. This allows for consumption of results before the poll has completed.

Errors

Any errors raised by tasks running within the poll will appear in the poll's errors attribute.

States

The state of a poll reflects only whether the poll is awaiting initialisation (pending), is in progress (processing), or all tasks have finished execution (completed).

A poll does not reflect any error states other than through its associated tasks.

Payload

The poll payload indicates which types of information, data types, and files it should work to retrieve. The poll payload attribute schema is described below.

nametypedescription
info_typeslist of info_type objectsSpecifies which info types should be retrieved. Supports wildcard *.
data_typeslist of data_type objectsSpecifies which data types should be retrieved.
fileslist of file IDs.Specifies which files to retrieve.
filtersnested filters objectSpecifies which filters to apply to retrieved data.
skip_filesbooleanIf set to true the poll will skip looking up and publishing attachments files, which includes any assets from photos or video feeds.

For example, the poll payload to retrieve all types of information on an iCloud account source would be:

{
  "info_types": ["*"]
}

To retrieved a variety of messaging data from an iCloud backup or Reincubate Relay source, but only from a certain date:

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

To retrieve file data for images referenced in an iCloud Photo Library result:

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

The different attributes can also be used simultaneously:

{
  "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.

nametypedescription
sinceoptional datetimeFilter to only data that was created after this datetime.
untiloptional datetimeFilter to only data that was created before this datetime.
phone_numbersoptional arrayFilter to only data that is related to phone numbers in this list.
exclude_phone_numbersoptional arrayFilter to only data that does not relate to phone numbers in this list.
email_addressesoptional arrayFilter to only data that is related to the email addresses in this list.
exclude_email_addressesoptional arrayFilter to only data that does not relate to the email addresses in this list.

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)

Data-level filters

Data-level filters, such as phone_numbers and email_addresses, are helpful to reduce processed data to just the items that are relevant to you. These are include filters that drop any data items that don't match or relate to another item that matches one of the values in the filter's list. Take the payload below, for example:

{
  "data_types": ["ios_messages.messages"],
  "filters": {
    "phone_numbers": ["0123456789"],
    "email_addresses": ["test@example.com"]
  }
}

This would return any messages from iOS Messages that relate to a conversation involving either the phone number or email address specified, including any group conversations. It can be helpful to specify multiple values to filter on, as many contacts will have a mix of phone numbers and email-identified accounts, such as Messages' iCloud accounts.

Exclusion-based filters, like exclude_phone_numbers and exclude_email_addresses, do the opposite: removing any data that relates to the values provided. If both inclusion- and exclusion-based filters are provided, and an item relates to both, then the exclusion-based filter wins. For example, a group conversation that contains one contact with an included email address but also another contact with an excluded phone number will get filtered out of the data.

Field-exclusion filters

The exclude filter works at the field level rather than the item level: instead of dropping whole data items, it omits the named fields from each extracted item. We recommend doing this in specific data type filters rather than broad filters to avoid inadvertently dropping fields from other data types.

{
  "data_types": [{
    "data_type: ""ios_contacts.contacts",
    "filters": {
      "exclude": ["photo"]
    }
  }],
}

This would return contacts data without contact photos.

The exclude filter is currently only supported by the ios_contacts.contacts data type, and the only excludable field is photo. Unrecognised values are ignored.

Create POST /polls

Create a poll for data against a specific session.

The source parameter should only be used when targeting a child source of the session's primary source. For example, if retrieving data from a rirelay.source the source parameter should be the ID of that source.

nametypedescription
keyoptional, key IDOptionally override the key used for this poll. This is useful when letting users trial new functionality.
sourceoptional, source IDOptionally target a child source of the session-linked source.
sessionsession IDThe session to be used to authenticate data retrieval.
subscriptionsubscription IDThe subscription to use to perform the poll. If this is provided, source and session can be omitted.
payloadnested poll payloadThe poll payload used to specify poll

Using 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": ["*"]
  }
}'

Using ricloud-py

import ricloud

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

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

Sample response

{
  "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
}

Resume POST /polls/{poll ID}/resume

Resume a poll by re-dispatching any suspended tasks and retrying failed file tasks. This can be used to trigger re-evaluation of requested files from Relay app instances, or for re-attempting file tasks which may have failed due to a transient issue.

nametypedescription
skip_missingoptional boolean, default falseIf set to true, the poll will continue processing until all available data and file results have been published, skipping any that are missing.
retry_filesoptional boolean, default trueIf set to true, any failed file publishing tasks will be retried.

Using cURL

curl https://ricloud-api.reincubate.com/polls/<poll ID>/resume \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{}'

To resume with specific options:

curl https://ricloud-api.reincubate.com/polls/<poll ID>/resume \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "skip_missing": true,
  "retry_files": false
}'

Retrieve GET /polls/{poll ID}

Using cURL

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

Using ricloud-py

import ricloud

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

List GET /polls

nametypedescription
keykey IDFilter by associated key. This is the key used by the user at the time.
useruser IDFilter by associated user.
sourcesource IDFilter by the target source.
sessionsession IDFilter by the target session.
subscriptionsubscription IDFilter by the associated subscription.
statestringFilter by session state.
date_createddatetime filterFilter by when the resource was created.
date_starteddatetime filterFilter by when the poll started.
date_completeddatetime filterFilter by when the poll was finished.

Using cURL

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

Using ricloud-py

import ricloud

polls = ricloud.Poll.list()

Changelog

2026-06-04

  • Add support for the exclude filter in poll payloads. This allows named output fields to be omitted from extracted data items. Currently only supported by the ios_contacts.contacts data type, for the photo field.

2026-03-06

  • Add POST /polls/{poll ID}/resume endpoint for resuming suspended tasks and retrying failed file tasks. Failed file tasks are retried by default.

2024-12-09

  • Add support for excluding data related to specific contact email addresses and phone numbers, via the exclude_phone_numbers and exclude_emails poll payload parameters.

2023-11-28

  • Add support for filtering data using contact email addresses and phone numbers via the phone_numbers and emails poll payload parameters.

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

  • The errors attribute was added to the poll object. This is a nested list object containing error objects associated with the poll.

2020-02-20

  • Major: The results attribute of the poll object is now a nested list object, rather than a simple list attribute. This makes it possible to paginate results when a poll publishes a large number of results.

2019-10-16

  • Adds the subscription attribute to the poll object to indicate whether the poll was triggered by a subscription.

2019-06-01

  • The poll object payload attribute can now be composed of multiple operation types. This means a poll can be created with any or all of info-types, data-types and files in the payload.
  • Major The type attribute on the poll object is deprecated in favour of composable poll payloads.

Articles liés

Besoin d'aide ?

Nous nous efforçons de répondre à tous les messages sous un jour ouvré.

support@reincubate.com
Logo du King's Award for Enterprise

King's Award for Enterprise : Reincubate a remporté quatre fois la plus haute distinction officielle des entreprises du Royaume-Uni, la plus récente en reconnaissance de la croissance exceptionnelle de l'entreprise au cours des trois dernières années.

Nos relations avec les utilisateurs et les partenaires sont au cœur de nos valeurs et des produits que nous créons. Consultez nos avis pour découvrir ce qu’ils disent de nous.

Certifié ISO 27001 par le Centre for Assessment, accrédité par l'UKAS

© 2008-2026 Reincubate Ltd. Tous droits réservés. Immatriculée en Angleterre et au pays de Galles sous le n° 5189175, TVA GB151788978. Camo®, Streamlight® et Reincubate® sont des marques déposées. Brevets en instance.

Aide