events_transports_create
POST/api/v3//events/transports/
NotificationTransport Viewset
Request
- application/json
Bodyrequired
namestringrequired
Possible values: non-empty
modeNotificationTransportModeEnum (string)
Possible values: [local
, webhook
, webhook_slack
, email
]
webhook_urluri
webhook_mapping_bodyuuidnullable
Customize the body of the request. Mapping should return data that is JSON-serializable.
webhook_mapping_headersuuidnullable
Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs
send_onceboolean
Only send notification once, for example when sending a webhook into a chat channel.
Responses
- 201
- 400
- 403
- application/json
- Schema
- Example (auto)
Schema
pkuuidrequired
namestringrequired
modeNotificationTransportModeEnum (string)
Possible values: [local
, webhook
, webhook_slack
, email
]
mode_verbosestringrequired
Return selected mode with a UI Label
webhook_urluri
webhook_mapping_bodyuuidnullable
Customize the body of the request. Mapping should return data that is JSON-serializable.
webhook_mapping_headersuuidnullable
Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs
send_onceboolean
Only send notification once, for example when sending a webhook into a chat channel.
{
"pk": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"mode": "local",
"mode_verbose": "string",
"webhook_url": "string",
"webhook_mapping_body": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"webhook_mapping_headers": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"send_once": true
}
- application/json
- Schema
- Example (auto)
Schema
non_field_errorsstring[]
codestring
property name*any
Validation Error
{
"non_field_errors": [
"string"
],
"code": "string"
}
- application/json
- Schema
- Example (auto)
Schema
detailstringrequired
codestring
{
"detail": "string",
"code": "string"
}
Authorization: http
name: authentiktype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "/api/v3/events/transports/");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"name\": \"string\",\n \"mode\": \"local\",\n \"webhook_url\": \"string\",\n \"webhook_mapping_body\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"webhook_mapping_headers\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"send_once\": true\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());