Zum Hauptinhalt springen

Keys

Veröffentlicht am 27. Juni 2019· Aktualisiert am 15. November 2022

Cover image for: Keys

A key gives access to the API at the organisation level via its token attribute. It is allowed to interact with all API endpoints on behalf of its organisation.

A key is generated for each newly created organisation.

Attributes

nametypedescription
idkey IDResource identifier.
resourcestring, always keyResource type specifier.
organisationorganisation IDThe organisation this key belongs to.
typestringOne of: standard, trial.
confignested objectKey-specific configuration settings.
storage_configoptional, storage config IDThe storage config used by the key.
webhook_configoptional, webhook config IDThe webhook config used by the key.
tokenstringThe auth material for this key. Is used to populate the AUTHORIZATION HTTP header in requests against the API.
statestringOne of: active, deactivated, blocked, expired.
date_createddatetimeWhen the resource was created.
date_expiresoptional, datetimeWhen the key will expire. Mainly applies to trial type keys.

Types

standard : the key type. Every organisation has at least one of these.

trial : a key generated by an API administrator to give the organisation trial access to additional permissions. These will typically have the date_expires field set.

Configuration

Key-level configuration can be set on the config attribute of the key. For the moment, this only accepts publish_source_files, related to the source file publishing mechanism.

Storage and webhook configs

A key resource can override the organisation default values for storage and webhook config. This can be helpful to split results and event notification between environments like dev and production.

Token

The value of a key's token attribute can be used to authenticate against the API on behalf of the owning organisation.

These values should be stored securely and never exposed publicly.

State

active : the key's standard state.

deactivated : the owning organisation has disabled the key.

blocked : the key has been disabled by an API admin.

expired : the key is disabled as the trial period has passed.

Create POST /keys

Parameters

nametypedescription
storage_configstorage config IDOverride the organisation's default storage config on this key.
webhook_configwebhook config IDOverride the organisation's default webhook config on this key.

Using cURL

curl 'https://ricloud-api.reincubate.com/keys' \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "storage_config": 2,
}'

Using ricloud-py

import ricloud

key = ricloud.Key.create(storage_config=2)

# OR

storage_config = ricloud.StorageConfig.retrieve(2)

key = ricloud.Key.create(storage_config=storage_config)

Retrieve GET /keys/{key ID}

Using cURL

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

Using ricloud-py

import ricloud

key = ricloud.Key.retrieve(<key ID>)

List GET /keys

Parameters

nametypedescription
typestringFilter keys by their type.
statestringFilter keys by their state.

Using cURL

curl 'https://ricloud-api.reincubate.com/keys?limit=2' \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

keys = ricloud.Key.list(limit=2)

Update POST /keys/{key ID}

Parameters

nametypedescription
storage_configstorage config IDUpdate the storage config used by the key. If null will fall back to organisation default.
webhook_configwebhook config IDUpdate the webhook config used by the key. If null will fall back to organisation default.

Using cURL

curl 'https://ricloud-api.reincubate.com/keys/<key ID>' \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "webhook_config": 2
}'

Using ricloud-py

import ricloud

key = ricloud.Key.update_with_id(<key ID>, webhook_config=2)

# OR

key = ricloud.Key.retrieve(<key ID>)

key.update(webhook_config=2)

Rotate POST /keys/{key ID}/rotate

Rotate the value of a key's token. Although not required, it is recommended to do this on a fairly regular basis or immediately if it is suspected the key's token has been compromised.

Parameters

nametypedescription
forcebool, default: FalseIf the current token value should be deauthorized immediately. If not, the current rotation period is 6 hours after the call is made.

Using cURL

curl 'https://ricloud-api.reincubate.com/keys/<key ID>/rotate' \
  -X POST \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

key = ricloud.Key.rotate_with_id(<key ID>)

# OR

key = ricloud.Key.retrieve(<key ID>)

key.rotate()

Verwandte Artikel

Brauchst du Hilfe?

Wir bemühen uns, alle Nachrichten innerhalb eines Werktags zu beantworten.

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

King's Award for Enterprise: Reincubate hat die höchste offizielle Wirtschaftsauszeichnung des Vereinigten Königreichs viermal gewonnen, zuletzt in Anerkennung des herausragenden Wachstums des Unternehmens in den vergangenen drei Jahren.

Unsere Beziehungen zu Nutzern und Partnern stehen im Mittelpunkt unserer Werte und der Produkte, die wir entwickeln. Lies unsere Bewertungen, um zu erfahren, was sie über uns sagen.

Nach ISO 27001 zertifiziert durch das Centre for Assessment, akkreditiert durch UKAS

© 2008-2026 Reincubate Ltd. Alle Rechte vorbehalten. Eingetragen in England und Wales unter der Nr. 5189175, USt-IdNr. GB151788978. Camo®, Streamlight® und Reincubate® sind eingetragene Marken. Patente angemeldet.

Hilfe