All URIs are relative to https://q.trap.jp/api/v3
Method | HTTP request | Description |
---|---|---|
EditChannelSubscribers | Patch /channels/{channelId}/subscribers | チャンネルの通知購読者を編集 |
GetChannelSubscribers | Get /channels/{channelId}/subscribers | チャンネルの通知購読者のリストを取得 |
GetMyChannelSubscriptions | Get /users/me/subscriptions | 自分のチャンネル購読状態を取得 |
GetMyUnreadChannels | Get /users/me/unread | 未読チャンネルを取得 |
GetMyViewStates | Get /users/me/view-states | 自身のチャンネル閲覧状態一覧を取得 |
ReadChannel | Delete /users/me/unread/{channelId} | チャンネルを既読にする |
RegisterFCMDevice | Post /users/me/fcm-device | FCMデバイスを登録 |
SetChannelSubscribeLevel | Put /users/me/subscriptions/{channelId} | チャンネル購読レベルを設定 |
SetChannelSubscribers | Put /channels/{channelId}/subscribers | チャンネルの通知購読者を設定 |
Ws | Get /ws | WebSocket通知ストリームに接続します |
EditChannelSubscribers(ctx, channelId).PatchChannelSubscribersRequest(patchChannelSubscribersRequest).Execute()
チャンネルの通知購読者を編集
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
patchChannelSubscribersRequest := *traq.NewPatchChannelSubscribersRequest() // PatchChannelSubscribersRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.EditChannelSubscribers(context.Background(), channelId).PatchChannelSubscribersRequest(patchChannelSubscribersRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.EditChannelSubscribers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
channelId | string | チャンネルUUID |
Other parameters are passed through a pointer to a apiEditChannelSubscribersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchChannelSubscribersRequest | PatchChannelSubscribersRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]string GetChannelSubscribers(ctx, channelId).Execute()
チャンネルの通知購読者のリストを取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.NotificationApi.GetChannelSubscribers(context.Background(), channelId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.GetChannelSubscribers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetChannelSubscribers`: []string
fmt.Fprintf(os.Stdout, "Response from `NotificationApi.GetChannelSubscribers`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
channelId | string | チャンネルUUID |
Other parameters are passed through a pointer to a apiGetChannelSubscribersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
[]string
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]UserSubscribeState GetMyChannelSubscriptions(ctx).Execute()
自分のチャンネル購読状態を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.NotificationApi.GetMyChannelSubscriptions(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.GetMyChannelSubscriptions``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMyChannelSubscriptions`: []UserSubscribeState
fmt.Fprintf(os.Stdout, "Response from `NotificationApi.GetMyChannelSubscriptions`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetMyChannelSubscriptionsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]UnreadChannel GetMyUnreadChannels(ctx).Execute()
未読チャンネルを取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.NotificationApi.GetMyUnreadChannels(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.GetMyUnreadChannels``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMyUnreadChannels`: []UnreadChannel
fmt.Fprintf(os.Stdout, "Response from `NotificationApi.GetMyUnreadChannels`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetMyUnreadChannelsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]MyChannelViewState GetMyViewStates(ctx).Execute()
自身のチャンネル閲覧状態一覧を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.NotificationApi.GetMyViewStates(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.GetMyViewStates``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMyViewStates`: []MyChannelViewState
fmt.Fprintf(os.Stdout, "Response from `NotificationApi.GetMyViewStates`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetMyViewStatesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReadChannel(ctx, channelId).Execute()
チャンネルを既読にする
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.ReadChannel(context.Background(), channelId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.ReadChannel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
channelId | string | チャンネルUUID |
Other parameters are passed through a pointer to a apiReadChannelRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RegisterFCMDevice(ctx).PostMyFCMDeviceRequest(postMyFCMDeviceRequest).Execute()
FCMデバイスを登録
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
postMyFCMDeviceRequest := *traq.NewPostMyFCMDeviceRequest("bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1") // PostMyFCMDeviceRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.RegisterFCMDevice(context.Background()).PostMyFCMDeviceRequest(postMyFCMDeviceRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.RegisterFCMDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Other parameters are passed through a pointer to a apiRegisterFCMDeviceRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
postMyFCMDeviceRequest | PostMyFCMDeviceRequest |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SetChannelSubscribeLevel(ctx, channelId).PutChannelSubscribeLevelRequest(putChannelSubscribeLevelRequest).Execute()
チャンネル購読レベルを設定
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
putChannelSubscribeLevelRequest := *traq.NewPutChannelSubscribeLevelRequest(traq.ChannelSubscribeLevel(0)) // PutChannelSubscribeLevelRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.SetChannelSubscribeLevel(context.Background(), channelId).PutChannelSubscribeLevelRequest(putChannelSubscribeLevelRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.SetChannelSubscribeLevel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
channelId | string | チャンネルUUID |
Other parameters are passed through a pointer to a apiSetChannelSubscribeLevelRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
putChannelSubscribeLevelRequest | PutChannelSubscribeLevelRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SetChannelSubscribers(ctx, channelId).PutChannelSubscribersRequest(putChannelSubscribersRequest).Execute()
チャンネルの通知購読者を設定
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
putChannelSubscribersRequest := *traq.NewPutChannelSubscribersRequest([]string{"On_example"}) // PutChannelSubscribersRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.SetChannelSubscribers(context.Background(), channelId).PutChannelSubscribersRequest(putChannelSubscribersRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.SetChannelSubscribers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
channelId | string | チャンネルUUID |
Other parameters are passed through a pointer to a apiSetChannelSubscribersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
putChannelSubscribersRequest | PutChannelSubscribersRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Ws(ctx).Execute()
WebSocket通知ストリームに接続します
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.NotificationApi.Ws(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.Ws``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiWsRequest struct via the builder pattern
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]