All URIs are relative to https://q.trap.jp/api/v3
Method | HTTP request | Description |
---|---|---|
AddUserTag | Post /users/{userId}/tags | ユーザーにタグを追加 |
ChangeUserIcon | Put /users/{userId}/icon | ユーザーのアイコン画像を変更します |
ChangeUserPassword | Put /users/{userId}/password | ユーザーのパスワードを変更 |
CreateUser | Post /users | ユーザーを登録 |
EditUser | Patch /users/{userId} | ユーザー情報を変更 |
EditUserTag | Patch /users/{userId}/tags/{tagId} | ユーザーのタグを編集 |
GetDirectMessages | Get /users/{userId}/messages | ダイレクトメッセージのリストを取得 |
GetUser | Get /users/{userId} | ユーザー詳細情報を取得 |
GetUserDMChannel | Get /users/{userId}/dm-channel | DMチャンネル情報を取得 |
GetUserIcon | Get /users/{userId}/icon | ユーザーのアイコン画像を取得 |
GetUserStats | Get /users/{userId}/stats | ユーザー統計情報を取得 |
GetUserTags | Get /users/{userId}/tags | ユーザーのタグリストを取得 |
GetUsers | Get /users | ユーザーのリストを取得 |
PostDirectMessage | Post /users/{userId}/messages | ダイレクトメッセージを送信 |
RemoveUserTag | Delete /users/{userId}/tags/{tagId} | ユーザーからタグを削除します |
UserTag AddUserTag(ctx, userId).PostUserTagRequest(postUserTagRequest).Execute()
ユーザーにタグを追加
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
postUserTagRequest := *traq.NewPostUserTagRequest("Tag_example") // PostUserTagRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.AddUserTag(context.Background(), userId).PostUserTagRequest(postUserTagRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.AddUserTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddUserTag`: UserTag
fmt.Fprintf(os.Stdout, "Response from `UserApi.AddUserTag`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiAddUserTagRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
postUserTagRequest | PostUserTagRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ChangeUserIcon(ctx, userId).File(file).Execute()
ユーザーのアイコン画像を変更します
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
file := os.NewFile(1234, "some_file") // *os.File | アイコン画像(2MBまでのpng, jpeg, gif)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.UserApi.ChangeUserIcon(context.Background(), userId).File(file).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.ChangeUserIcon``: %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. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiChangeUserIconRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
file | *os.File | アイコン画像(2MBまでのpng, jpeg, gif) |
(empty response body)
- Content-Type: multipart/form-data
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ChangeUserPassword(ctx, userId).PutUserPasswordRequest(putUserPasswordRequest).Execute()
ユーザーのパスワードを変更
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
putUserPasswordRequest := *traq.NewPutUserPasswordRequest("NewPassword_example") // PutUserPasswordRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.UserApi.ChangeUserPassword(context.Background(), userId).PutUserPasswordRequest(putUserPasswordRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.ChangeUserPassword``: %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. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiChangeUserPasswordRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
putUserPasswordRequest | PutUserPasswordRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserDetail CreateUser(ctx).PostUserRequest(postUserRequest).Execute()
ユーザーを登録
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
postUserRequest := *traq.NewPostUserRequest("Name_example") // PostUserRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.CreateUser(context.Background()).PostUserRequest(postUserRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateUser`: UserDetail
fmt.Fprintf(os.Stdout, "Response from `UserApi.CreateUser`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
postUserRequest | PostUserRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EditUser(ctx, userId).PatchUserRequest(patchUserRequest).Execute()
ユーザー情報を変更
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
patchUserRequest := *traq.NewPatchUserRequest() // PatchUserRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.UserApi.EditUser(context.Background(), userId).PatchUserRequest(patchUserRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.EditUser``: %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. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiEditUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchUserRequest | PatchUserRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EditUserTag(ctx, userId, tagId).PatchUserTagRequest(patchUserTagRequest).Execute()
ユーザーのタグを編集
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
tagId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | タグUUID
patchUserTagRequest := *traq.NewPatchUserTagRequest(false) // PatchUserTagRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.UserApi.EditUserTag(context.Background(), userId, tagId).PatchUserTagRequest(patchUserTagRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.EditUserTag``: %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. | |
userId | string | ユーザーUUID | |
tagId | string | タグUUID |
Other parameters are passed through a pointer to a apiEditUserTagRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchUserTagRequest | PatchUserTagRequest | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Message GetDirectMessages(ctx, userId).Limit(limit).Offset(offset).Since(since).Until(until).Inclusive(inclusive).Order(order).Execute()
ダイレクトメッセージのリストを取得
package main
import (
"context"
"fmt"
"os"
"time"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
limit := int32(50) // int32 | 取得する件数 (optional)
offset := int32(150) // int32 | 取得するオフセット (optional) (default to 0)
since := time.Now() // time.Time | 取得する時間範囲の開始日時 (optional) (default to "0000-01-01T00:00Z")
until := time.Now() // time.Time | 取得する時間範囲の終了日時 (optional)
inclusive := true // bool | 範囲の端を含めるかどうか (optional) (default to false)
order := "order_example" // string | 昇順か降順か (optional) (default to "desc")
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetDirectMessages(context.Background(), userId).Limit(limit).Offset(offset).Since(since).Until(until).Inclusive(inclusive).Order(order).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetDirectMessages``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDirectMessages`: []Message
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetDirectMessages`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiGetDirectMessagesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int32 | 取得する件数 | offset | int32 | 取得するオフセット | [default to 0] since | time.Time | 取得する時間範囲の開始日時 | [default to "0000-01-01T00:00Z"] until | time.Time | 取得する時間範囲の終了日時 | inclusive | bool | 範囲の端を含めるかどうか | [default to false] order | string | 昇順か降順か | [default to "desc"]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserDetail GetUser(ctx, userId).Execute()
ユーザー詳細情報を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUser(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUser`: UserDetail
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DMChannel GetUserDMChannel(ctx, userId).Execute()
DMチャンネル情報を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUserDMChannel(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserDMChannel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUserDMChannel`: DMChannel
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserDMChannel`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string |
Other parameters are passed through a pointer to a apiGetUserDMChannelRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
*os.File GetUserIcon(ctx, userId).Execute()
ユーザーのアイコン画像を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUserIcon(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserIcon``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUserIcon`: *os.File
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserIcon`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiGetUserIconRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- 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]
UserStats GetUserStats(ctx, userId).Execute()
ユーザー統計情報を取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUserStats(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserStats``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUserStats`: UserStats
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserStats`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiGetUserStatsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]UserTag GetUserTags(ctx, userId).Execute()
ユーザーのタグリストを取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUserTags(context.Background(), userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserTags``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUserTags`: []UserTag
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserTags`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiGetUserTagsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]User GetUsers(ctx).IncludeSuspended(includeSuspended).Name(name).Execute()
ユーザーのリストを取得
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
includeSuspended := true // bool | アカウントがアクティブでないユーザーを含め、全てのユーザーを取得するかどうか (optional) (default to false)
name := "name_example" // string | 名前が一致するアカウントのみを取得する (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.GetUsers(context.Background()).IncludeSuspended(includeSuspended).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUsers`: []User
fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUsers`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetUsersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
includeSuspended | bool | アカウントがアクティブでないユーザーを含め、全てのユーザーを取得するかどうか | [default to false] |
name | string | 名前が一致するアカウントのみを取得する |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Message PostDirectMessage(ctx, userId).PostMessageRequest(postMessageRequest).Execute()
ダイレクトメッセージを送信
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
postMessageRequest := *traq.NewPostMessageRequest("Content_example") // PostMessageRequest | (optional)
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
resp, r, err := apiClient.UserApi.PostDirectMessage(context.Background(), userId).PostMessageRequest(postMessageRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.PostDirectMessage``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostDirectMessage`: Message
fmt.Fprintf(os.Stdout, "Response from `UserApi.PostDirectMessage`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userId | string | ユーザーUUID |
Other parameters are passed through a pointer to a apiPostDirectMessageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
postMessageRequest | PostMessageRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveUserTag(ctx, userId, tagId).Execute()
ユーザーからタグを削除します
package main
import (
"context"
"fmt"
"os"
traq "github.com/traPtitech/go-traq"
)
func main() {
userId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ユーザーUUID
tagId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | タグUUID
configuration := traq.NewConfiguration()
apiClient := traq.NewAPIClient(configuration)
r, err := apiClient.UserApi.RemoveUserTag(context.Background(), userId, tagId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserApi.RemoveUserTag``: %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. | |
userId | string | ユーザーUUID | |
tagId | string | タグUUID |
Other parameters are passed through a pointer to a apiRemoveUserTagRequest 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]