Skip to content

Latest commit

 

History

History
491 lines (343 loc) · 15.8 KB

WebhookAPI.md

File metadata and controls

491 lines (343 loc) · 15.8 KB

WebhookAPI

All URIs are relative to https://q.trap.jp/api/v3

Method HTTP request Description
changeWebhookIcon PUT /webhooks/{webhookId}/icon Webhookのアイコンを変更
createWebhook POST /webhooks Webhookを新規作成
deleteWebhook DELETE /webhooks/{webhookId} Webhookを削除
editWebhook PATCH /webhooks/{webhookId} Webhook情報を変更
getWebhook GET /webhooks/{webhookId} Webhook情報を取得
getWebhookIcon GET /webhooks/{webhookId}/icon Webhookのアイコンを取得
getWebhookMessages GET /webhooks/{webhookId}/messages Webhookの投稿メッセージのリストを取得
getWebhooks GET /webhooks Webhook情報のリストを取得します
postWebhook POST /webhooks/{webhookId} Webhookを送信

changeWebhookIcon

    open class func changeWebhookIcon(webhookId: UUID, file: URL, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Webhookのアイコンを変更

指定したWebhookのアイコン画像を変更します。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID
let file = URL(string: "https://example.com")! // URL | アイコン画像(2MBまでのpng, jpeg, gif)

// Webhookのアイコンを変更
WebhookAPI.changeWebhookIcon(webhookId: webhookId, file: file) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID
file URL アイコン画像(2MBまでのpng, jpeg, gif)

Return type

Void (empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createWebhook

    open class func createWebhook(postWebhookRequest: PostWebhookRequest? = nil, completion: @escaping (_ data: Webhook?, _ error: Error?) -> Void)

Webhookを新規作成

Webhookを新規作成します。 secretが空文字の場合、insecureウェブフックが作成されます。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let postWebhookRequest = PostWebhookRequest(name: "name_example", description: "description_example", channelId: 123, secret: "secret_example") // PostWebhookRequest |  (optional)

// Webhookを新規作成
WebhookAPI.createWebhook(postWebhookRequest: postWebhookRequest) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
postWebhookRequest PostWebhookRequest [optional]

Return type

Webhook

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteWebhook

    open class func deleteWebhook(webhookId: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Webhookを削除

指定したWebhookを削除します。 Webhookによって投稿されたメッセージは削除されません。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID

// Webhookを削除
WebhookAPI.deleteWebhook(webhookId: webhookId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID

Return type

Void (empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

editWebhook

    open class func editWebhook(webhookId: UUID, patchWebhookRequest: PatchWebhookRequest? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Webhook情報を変更

指定したWebhookの情報を変更します。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID
let patchWebhookRequest = PatchWebhookRequest(name: "name_example", description: "description_example", channelId: 123, secret: "secret_example", ownerId: 123) // PatchWebhookRequest |  (optional)

// Webhook情報を変更
WebhookAPI.editWebhook(webhookId: webhookId, patchWebhookRequest: patchWebhookRequest) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID
patchWebhookRequest PatchWebhookRequest [optional]

Return type

Void (empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhook

    open class func getWebhook(webhookId: UUID, completion: @escaping (_ data: Webhook?, _ error: Error?) -> Void)

Webhook情報を取得

指定したWebhookの詳細を取得します。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID

// Webhook情報を取得
WebhookAPI.getWebhook(webhookId: webhookId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID

Return type

Webhook

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhookIcon

    open class func getWebhookIcon(webhookId: UUID, completion: @escaping (_ data: URL?, _ error: Error?) -> Void)

Webhookのアイコンを取得

指定したWebhookのアイコン画像を取得します

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID

// Webhookのアイコンを取得
WebhookAPI.getWebhookIcon(webhookId: webhookId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID

Return type

URL

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: image/jpeg, image/gif, image/png

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhookMessages

    open class func getWebhookMessages(webhookId: UUID, limit: Int? = nil, offset: Int? = nil, since: Date? = nil, until: Date? = nil, inclusive: Bool? = nil, order: Order_getWebhookMessages? = nil, completion: @escaping (_ data: [Message]?, _ error: Error?) -> Void)

Webhookの投稿メッセージのリストを取得

指定されたWebhookが投稿したメッセージのリストを返します。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID
let limit = 987 // Int | 取得する件数 (optional)
let offset = 987 // Int | 取得するオフセット (optional) (default to 0)
let since = Date() // Date | 取得する時間範囲の開始日時 (optional) (default to Date(timeIntervalSince1970: -62167219200000000.0 / 1_000_000))
let until = Date() // Date | 取得する時間範囲の終了日時 (optional)
let inclusive = true // Bool | 範囲の端を含めるかどうか (optional) (default to false)
let order = "order_example" // String | 昇順か降順か (optional) (default to .desc)

// Webhookの投稿メッセージのリストを取得
WebhookAPI.getWebhookMessages(webhookId: webhookId, limit: limit, offset: offset, since: since, until: until, inclusive: inclusive, order: order) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID
limit Int 取得する件数 [optional]
offset Int 取得するオフセット [optional] [default to 0]
since Date 取得する時間範囲の開始日時 [optional] [default to Date(timeIntervalSince1970: -62167219200000000.0 / 1_000_000)]
until Date 取得する時間範囲の終了日時 [optional]
inclusive Bool 範囲の端を含めるかどうか [optional] [default to false]
order String 昇順か降順か [optional] [default to .desc]

Return type

[Message]

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhooks

    open class func getWebhooks(all: Bool? = nil, completion: @escaping (_ data: [Webhook]?, _ error: Error?) -> Void)

Webhook情報のリストを取得します

Webhookのリストを取得します。 allがtrueで無い場合は、自分がオーナーのWebhookのリストを返します。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let all = true // Bool | 全てのWebhookを取得します。権限が必要です。 (optional) (default to false)

// Webhook情報のリストを取得します
WebhookAPI.getWebhooks(all: all) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
all Bool 全てのWebhookを取得します。権限が必要です。 [optional] [default to false]

Return type

[Webhook]

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

postWebhook

    open class func postWebhook(webhookId: UUID, xTRAQSignature: String? = nil, xTRAQChannelId: String? = nil, embed: Int? = nil, body: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Webhookを送信

Webhookにメッセージを投稿します。 secureなウェブフックに対してはX-TRAQ-Signatureヘッダーが必須です。 アーカイブされているチャンネルには投稿できません。

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Traq

let webhookId = 987 // UUID | WebhookUUID
let xTRAQSignature = "xTRAQSignature_example" // String | リクエストボディシグネチャ(Secretが設定されている場合は必須) (optional)
let xTRAQChannelId = "xTRAQChannelId_example" // String | 投稿先のチャンネルID(変更する場合) (optional)
let embed = 987 // Int | メンション・チャンネルリンクを自動埋め込みする場合に1を指定する (optional) (default to 0)
let body = "body_example" // String |  (optional)

// Webhookを送信
WebhookAPI.postWebhook(webhookId: webhookId, xTRAQSignature: xTRAQSignature, xTRAQChannelId: xTRAQChannelId, embed: embed, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
webhookId UUID WebhookUUID
xTRAQSignature String リクエストボディシグネチャ(Secretが設定されている場合は必須) [optional]
xTRAQChannelId String 投稿先のチャンネルID(変更する場合) [optional]
embed Int メンション・チャンネルリンクを自動埋め込みする場合に1を指定する [optional] [default to 0]
body String [optional]

Return type

Void (empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: text/plain
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]