투표소

업데이트 됨
Cover image for: 투표소

폴링 자원은 데이터에 대한 특정 요청에 대한 정보를 포함합니다. 설문 조사가 만들어지면 요청을 완료하기 위해 하나 이상의 작업 생성이 시작됩니다.

속성

이름 유형 설명
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.

작업

폴링 리소스의 가장 중요한 역할은 관련 작업의 진행률을 반영하고 최종 사용자가 결과가 나 오자마자 결과를 가져 오는 것을 허용하는 것입니다. 따라서 폴 자원은 관련 태스크가 해당 상태에 따라 분류되는 태스크 관련 속성을 노출합니다.

결과

설문 조사 내에서 실행중인 태스크가 공개 한 모든 결과는 설문 조사의 results 속성에 표시됩니다. 이렇게하면 설문 조사가 완료되기 전에 결과를 사용할 수 있습니다.

오류

설문 조사 내에서 실행중인 태스크로 인해 발생한 모든 오류는 설문 조사의 errors 속성에 나타납니다.

설문 조사 상태는 설문 조사가 초기화 pending ( pending ), 진행 중 ( processing ) 또는 모든 작업 완료 ( completed pending )인지 여부 만 반영합니다.

설문 조사는 관련 작업을 통한 오류 상태 이외의 오류 상태를 반영하지 않습니다.

유효 탑재량

폴링 페이로드는 검색해야하는 정보 유형, 데이터 유형 및 파일 유형을 나타냅니다. 폴 페이로드 속성 스키마는 아래에 설명되어 있습니다.

이름 유형 설명
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.

예를 들어, iCloud 계정 소스에서 모든 유형의 정보를 검색하기위한 폴 페이로드는 다음과 같습니다.

{
  "info_types": ["*"]
}

iCloud 백업 또는 Reincubate Relay 소스에서 특정 날짜에서만 다양한 메시징 데이터를 검색하려면 다음을 수행하십시오.

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

iCloud 사진 보관함 결과에서 참조 된 이미지의 파일 데이터를 검색하려면 :

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

다른 속성을 동시에 사용할 수도 있습니다.

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

POST /polls 만들기 만들기

특정 세션에 대한 데이터 폴링을 작성하십시오.

source 매개 변수는 세션 기본 소스의 하위 소스를 대상으로하는 경우에만 사용해야합니다. 예를 들어 rirelay.source 에서 데이터를 검색하는 경우 source 매개 변수는 해당 소스의 ID 여야합니다.

이름 유형 설명
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

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

ricloud-py 사용하기

import ricloud

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

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

샘플 응답

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

GET /polls/{poll ID}

cURL 사용

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

ricloud-py 사용하기

import ricloud

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

GET /polls 나열

이름 유형 설명
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.

cURL 사용

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

ricloud-py 사용하기

import ricloud

polls = ricloud.Poll.list()

변경 로그

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

  • errors 속성이 폴링 오브젝트에 추가되었습니다. 이것은 폴과 연관된 오류 오브젝트를 포함하는 중첩 목록 오브젝트입니다.

2020-02-20

  • Major : poll 객체의 results 속성은 이제 단순한 list 속성이 아니라 중첩 된 목록 객체입니다. 따라서 설문 조사에서 많은 수의 결과를 게시 할 때 결과를 페이지 매김 할 수 있습니다.

2019-10-16

  • subscription 이 폴링을 트리거했는지 여부를 표시하기 위해 subscription 속성을 폴링 오브젝트에 추가합니다.

2019-06-01

  • 폴링 오브젝트 payload 속성은 이제 여러 조작 유형으로 구성 될 수 있습니다. 이는 페이로드에서 info-types , data-typesfiles 중 일부 또는 전부를 사용하여 폴링을 작성할 수 있음을 의미합니다.
  • 중요 사항 폴링 오브젝트의 type 속성은 작성 가능한 폴링 페이로드를 위해 더 이상 사용되지 않습니다.

어떻게 도와 드릴까요?

지원 팀이 도와 드리겠습니다!

근무 시간은 월요일부터 금요일, 오전 9 시부 터 오후 5시 (그리니치 표준시)입니다. 시간은 현재 5:47 오전 GMT입니다.

우리는 1 일 이내에 모든 메시지에 답장하고자합니다.

우리의 멋진 지원 팀

© 2008 - 2023 Reincubate Ltd. 판권 소유. 영국과 웨일즈에 등록 #5189175, VAT GB151788978. Reincubate® 및 Camo®는 등록 상표입니다. 개인 정보 정책 & 자귀. 런던에서 Built로 지어졌습니다.