Go API リファレンス
メッセージ内のトークンをカウント
client.Messages.CountTokens(ctx, params) (*MessageTokensCount, error)POST/v1/messages/count_tokens
メッセージ内のトークン数をカウントします。
ファイルをダウンロード
client.Files.Download(ctx, fileID, query) (*Response, error)GET/v1/files/{file_id}/content
ファイルのメタデータを取得
client.Files.GetMetadata(ctx, fileID, query) (*FileMetadata, error)GET/v1/files/{file_id}
ユーザープロファイル
プラットフォームがサービスを提供するエンドカスタマーを登録し、各リクエストで対象者を指定できるようにします。始めるには、ユーザープロファイルガイドを参照してください。
ユーザープロファイルを作成
client.UserProfiles.New(ctx, params) (*UserProfile, error)POST/v1/user_profiles
エンドカスタマーを1つ登録し、そのエンドカスタマーのために行うリクエストで送信するIDを取得します。
ユーザープロファイルの一覧を取得
client.UserProfiles.List(ctx, params) (*PageCursor[UserProfile], error)GET/v1/user_profiles
組織内のユーザープロファイルの一覧を取得します。デフォルトでは新しい順に並びます。
ユーザープロファイルを取得
client.UserProfiles.Get(ctx, userProfileID, query) (*UserProfile, error)GET/v1/user_profiles/{user_profile_id}
IDを指定してユーザープロファイルを取得し、保存されている詳細情報を確認します。
ユーザープロファイルを更新
client.UserProfiles.Update(ctx, userProfileID, params) (*UserProfile, error)POST/v1/user_profiles/{user_profile_id}
ユーザープロファイルの詳細情報を変更します。送信しないフィールドはそのまま保持されます。
ユーザープロファイルを削除
client.UserProfiles.Delete(ctx, userProfileID, body) (*DeletedUserProfile, error)DELETE/v1/user_profiles/{user_profile_id}
エンドカスタマーがアカウントを閉鎖した場合などに、ユーザープロファイルを削除します。
現在の組織を取得
client.Organization.Get(ctx) (*OrganizationInfo, error)GET/v1/organizations/me
認証されたAPIキーに関連付けられた組織に関する情報を取得します。