Ga naar hoofdinhoud

Sources

Gepubliceerd op 27 juni 2019· Bijgewerkt op 13 mei 2020

Cover image for: Sources

A source represents a source of data from a service. For example, an iCloud account is a source of the iCloud service.

Sources can have child sources, such as a rirelay.instance source having multiple rirelay.source sources which can be targeted individually.

Attributes

nametypedescription
idsource IDResource identifier.
resourcestring, always sourceResource type specifier.
useruser IDThe user associated with this source.
typestringThe type of this source, for example icloud.account.
identifierstringA unique identifier for the source within the scope of its service.
parentoptional, source IDPopulated if the source is a child of another.
childrenlist object containing source resourcesContains any sub-sources of the source.
statestringOne of: unvalidated, active, deactivated, blocked, locked.
date_createddatetimeWhen the resource was created.

Types

Currently supported types include:

  • icloud.account, the primary source on the iCloud service.
  • rirelay.instance, the primary source on the rirelay service. Corresponds to an instance of the Reincubate Relay application.
  • rirelay.source, a child source of rirelay.instance. Corresponds to a device that the parent Reincubate Relay app has access to.

Identifier

The value of a source's identifier attribute identifies it uniquely within its service. For an iCloud account this would be the username. For a Reincubate Relay app instance it would be the instance ID.

Parent

If the source is a child source this field will point to its parent source object. The top source in this hierarchy is referred to as the primary source.

A child source cannot be created directly via the API, but are automatically created by the API when the appropriate poll is created.

States

unvalidated : a session has never been successfully created against this source, therefore the API cannot tell if it is a valid source.

active : the source has been validated and is ready for use.

deactivated : access to the source has been forbidden by the owning organisation.

blocked : access to the source has been forbidden by an API admin.

locked : access to the source has been temporarily restricted by the external service.

Retrieve GET /sources/{source ID}

Using cURL

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

Using ricloud-py

import ricloud

source = ricloud.Source.create(<source ID>)

Sample response

{
  "id": 1,
  "resource": "source",
  "user": 1,
  "type": "mocks.mock",
  "identifier": "john.appleseed@reincubate.com",
  "info": null,
  "parent": null,
  "children": {
      "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/sources/1/children"
  },
  "state": "active",
  "date_created": "2020-02-20T11:59:03.195527Z"
}

List GET /sources

nametypedescription
organisationsuper, organisation IDFor API admins to filter by organisation.
useruser IDFilter by associated user.
typestringFilter by source type.
identifierstringFilter by source identifier.
statestringFilter by source state.
date_createddatetime filterFilter by resource creation date.

Using cURL

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

Using ricloud-py

import ricloud

sources = ricloud.Source.list()

Update POST /sources/{source ID}

nametypedescription
statestringUpdate the source state.

Using cURL

curl https://ricloud-api.reincubate.com/sources/<source ID> \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "state": "deactivated"
}'

Using ricloud-py

import ricloud

source = ricloud.Source.update_with_id(<source ID>, state='deactivated')

# OR

source = ricloud.Source.retrieve(<source ID>)

source.update(state='deactivated')

Changelog

2020-02-20

  • Major The children attribute of the source object is now a nested list object, rather than a simple list attribute.

2019-10-16

  • Adds two new source types: rirelay.instance and rirelay.source.

Gerelateerde artikelen

Hulp nodig?

We streven ernaar om alle berichten binnen één werkdag te beantwoorden.

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

King's Award for Enterprise: Reincubate heeft vier keer de hoogste officiële zakelijke onderscheiding van het Verenigd Koninkrijk gewonnen, het meest recent als erkenning voor de uitzonderlijke groei van het bedrijf in de afgelopen drie jaar.

Onze relaties met gebruikers en partners staan centraal in onze waarden en de producten die we maken. Bekijk onze reviews om te horen wat zij over ons te zeggen hebben.

ISO 27001-gecertificeerd door Centre for Assessment, geaccrediteerd door UKAS

© 2008-2026 Reincubate Ltd. Alle rechten voorbehouden. Ingeschreven in Engeland en Wales onder nr. 5189175, btw-nummer GB151788978. Camo®, Streamlight® en Reincubate® zijn geregistreerde handelsmerken. Octrooien aangevraagd.

Hulp