メインコンテンツへスキップ

Keys

公開日: 2019年6月27日· 更新日: 2022年11月15日

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()

関連記事

お困りですか?

すべてのお問い合わせに1営業日以内に返信するよう努めています。

support@reincubate.com
King's Award for Enterprise のロゴ

King's Award for Enterprise:Reincubate は英国最高峰の公式ビジネス表彰を4度受賞しており、直近では過去3年間にわたる同社の卓越した成長が評価されました。

ユーザーやパートナーとの関係は、私たちの価値観と開発する製品の中心にあります。レビュー をご覧いただき、皆さまの声をお聞きください。

Centre for Assessment による ISO 27001 認証取得、UKAS 認定

© 2008-2026 Reincubate Ltd. 無断複写・転載を禁じます。イングランドおよびウェールズ登記番号 5189175、VAT 番号 GB151788978。Camo®、Streamlight®、Reincubate® は登録商標です。特許出願中。

ヘルプ