通知先作成

Prev Next
Post
/api/notification_destinations/{type}

通知先(email、slack_channel または http)を作成します。
type=email の場合は email_config.email を、
type=slack_channel の場合は slack_channel_config.channel および slack_channel_config.webhook_url を、
type=http の場合は http_config.name および http_config.url を指定してください。

Security
API Key: ApiKeyAuth
Header parameter nameAuthorization

認証キーとなるAPI KEYをAuthorization: Token {{API KEY}}の形式でヘッダーにセットします。
API KEYがabc123の場合は、Authorization: Token abc123とします。
API KEYの作成方法は、TROCCO API KEYの作成を参照ください。

Path parameters
type
stringRequired

通知先種別(email、slack_channel または http)

Valid values[ "email", "slack_channel", "http" ]
Exampleemail
Body parameters
Expand All
OneOf
object
object
email_config
object Required
email
string Required
Exampletest@example.com
object
object
slack_channel_config
object Required
channel
string Required
Example#general
webhook_url
string Required
Examplehttps://hooks.slack_channel.com/services/XXXX/XXXX/XXXX
object
object
http_config
object Required
name
string Required

通知先の名前。

ExampleMy Webhook
url
string Required

リクエスト先のURL。TROCCOのドメインは指定できません。

Examplehttps://example.com/webhook
description
string

通知先の説明。

ExampleSlack Incoming Webhook
headers
Array of object

リクエストヘッダーの一覧。

object
key
string Required
ExampleAuthorization
value
string Required
ExampleBearer xxxx
masking
boolean Required

value をレスポンスでマスキングするかどうか。

Exampletrue
query_params
Array of object

クエリパラメータの一覧。

object
key
string Required
Exampletoken
value
string Required
Examplexxxx
masking
boolean Required

value をレスポンスでマスキングするかどうか。

Exampletrue
Responses
201

作成した通知先の詳細を返します。

Expand All
object
Example{ "id": 1, "type": "email", "email": "test@example.com" }
id
integer (int64)

通知先のIDです。

type
string

通知先の種類です。

Valid values[ "email", "slack_channel", "http" ]
Exampleemail
email
string

type=email の場合に設定されるメールアドレスです。

Exampletest@example.com
channel
string | null

type=slack_channel の場合に設定されるチャンネル名です。

Example#general
name
string

type=http の場合に設定される通知先の名前です。

ExampleMy Webhook
url
string

type=http の場合に設定されるリクエスト先のURLです。

Examplehttps://example.com/webhook
description
string | null

type=http の場合に設定される通知先の説明です。

ExampleSlack Incoming Webhook
headers
Array of object

type=http の場合に設定されるリクエストヘッダーの一覧です(id 昇順)。
masking=true のヘッダーの value は空文字で返却されます。

object
id
integer (int64)

ヘッダーのIDです。

key
string

ヘッダー名です。

ExampleAuthorization
value
string

ヘッダーの値です。masking=true の場合は空文字が返却されます。

ExampleBearer xxxx
masking
boolean

value をレスポンスでマスキングするかどうかです。

Exampletrue
query_params
Array of object

type=http の場合に設定されるクエリパラメータの一覧です(id 昇順)。
masking=true のクエリパラメータの value は空文字で返却されます。

object
id
integer (int64)

クエリパラメータのIDです。

key
string

クエリパラメータ名です。

Exampletoken
value
string

クエリパラメータの値です。masking=true の場合は空文字が返却されます。

Examplexxxx
masking
boolean

value をレスポンスでマスキングするかどうかです。

Exampletrue
400

不正なリクエストです。

401

API KEYが不正です。

404

指定した通知先が存在しません。