본문으로 건너뛰기
Reincubate

Subscriptions

게시일: 2019년 10월 14일· 업데이트: 2020년 5월 12일

Cover image for: Subscriptions

A subscription object represents a continuing request for data, such as "retrieve new CallKit calls every 24 hours" or "retrieve the latest iOS messages from a Reincubate Relay source when a new backup is made".

Different services can implement subscriptions in slightly different ways. The iCloud service works on a periodic polling mechanism, whereby it checks for new data every set interval of time. The rirelay service works on a push mechanism, publishing new data as soon as it becomes available.

Attributes

nametypedescription
idstringResource identifier.
resourcestring, always subscriptionResource type identifier.
orgorganisation IDThe subscription's associated organisation.
sourcesource ID
sessionsession ID
poll_payloadnested poll payloadThe payload of polls to be created by the subscription. See poll payload.
intervaloptional timedeltaThe interval between polls, in seconds.
date_startoptional datetimeThe date to start creating polls.
date_endoptional datetimeThe date to stop creating polls.
statestringOne of: pending, active, deleted.
date_createddatetimeWhen the resource was created.

Interval

The interval attribute controls the frequency at which the API will pull in or request new data from a source.

On the iCloud service, which is pull-based, the subscription will create a new poll every interval seconds.

On the Reincubate Relay service, the interval attribute is instead passed through to the Relay app. This configures how often the app will request new data from connected devices, wish then triggers a poll on the API via a push mechanism. No poll is created until the device associated with the subscription's source is connected to the Relay app.

Create POST /subscriptions

nametypedescription
sessionsession IDWhich session to create polls against.
sourceoptional, source IDOptionally target a child source of the session-linked source.
poll_payloadnested poll payloadThe poll payload used to specify poll
intervaloptional timedeltaThe interval between polls, in seconds.
date_startoptional datetimeThe date to start creating polls.
date_endoptional datetimeThe date to stop creating polls.

Using cURL

curl https://ricloud-api.reincubate.com/subscriptions \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "session": "<session ID>",
  "source": "<source ID>",
  "poll_payload": {
    "data_types": ["ios_messages.messages", "whatsapp.messages"]
  }
}'

Using ricloud-py

import ricloud

poll_payload = {
  "data_types": ["ios_messages.messages", "whatsapp.messages"],
}

subscription = ricloud.Subscription.create(
  session="<session ID or ricloud.Session instance>",
  source="<source ID or ricloud.Source instance>",
  poll_payload=poll_payload,
)

Retrieve GET /subscriptions/{subscription ID}

Using cURL

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

Using ricloud-py

import ricloud

subscription = ricloud.Subscription.retrieve(<subscription ID>)

List GET /subscriptions

Using cURL

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

Using ricloud-py

import ricloud

subscriptions = ricloud.Subscription.list()

Update POST /subscriptions/{subscription ID}

A subscription can be updated to change the polls it creates and when it creates them.

Also, in the case a subscription's session expires it can be replaced with a newly created, active session.

nametypedescription
sessionsession IDWhich session to create polls against. Must have the same underlying source as the subscription's original session.
poll_payloadnested poll payloadThe poll payload used to specify poll.
intervaloptional timedeltaThe interval between polls, in seconds.
date_startoptional datetimeThe date to start creating polls.
date_endoptional datetimeThe date to stop creating polls.

Using cURL

curl https://ricloud-api.reincubate.com/subscriptions/<subscription ID> \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "session": "<session ID>",
  "poll_payload": {
    "data_types": ["icpl.photos"]
  }
}'

Using ricloud-py

import ricloud

poll_payload = {
  "data_types": ["icpl.photos"],
}

subscription = ricloud.Subscription.update(
  session="<session ID or ricloud.Session instance>",
  poll_payload=poll_payload,
)

Delete DELETE /subscriptions/{subscription ID}

Stop the subscription from creating further polls.

Using cURL

curl https://ricloud-api.reincubate.com/subscriptions/<subscription ID> \
  -X DELETE \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

subscription = ricloud.Subscription.delete_with_id(<subscription ID>)

# OR

subscription = ricloud.Subscription.retrieve(<subscription ID>)

subscription.delete()

관련 문서

도움이 필요하신가요?

모든 문의에 영업일 기준 1일 이내에 답변드리도록 노력하고 있습니다.

support@reincubate.com
King's Award for Enterprise 로고

King's Award for Enterprise: Reincubate는 영국 최고의 공식 비즈니스 영예를 네 차례 수상했으며, 가장 최근에는 지난 3년간의 뛰어난 성장을 인정받았습니다.

사용자 및 파트너와의 관계는 우리의 가치와 우리가 만드는 제품의 핵심입니다. 리뷰을(를) 통해 그들의 이야기를 들어보세요.

Centre for Assessment의 ISO 27001 인증, UKAS 공인

© 2008-2026 Reincubate Ltd. 모든 권리 보유. 잉글랜드 및 웨일스 등록 번호 5189175, VAT 번호 GB151788978. Camo®, Streamlight® 및 Reincubate®는 등록 상표입니다. 특허 출원 중.

도움말