All URIs are relative to https://q.trap.jp/api/v3
Method | HTTP request | Description |
---|---|---|
add_my_star | POST /users/me/stars | チャンネルをスターに追加 |
get_my_stars | GET /users/me/stars | スターチャンネルリストを取得 |
remove_my_star | DELETE /users/me/stars/{channelId} | チャンネルをスターから削除します |
add_my_star()
チャンネルをスターに追加
指定したチャンネルをスターチャンネルに追加します。 不正なチャンネルIDを指定した場合、400を返します。
- OAuth Authentication (OAuth2):
import time
import traq
from traq.api import star_api
from traq.model.post_star_request import PostStarRequest
from pprint import pprint
# Defining the host is optional and defaults to https://q.trap.jp/api/v3
# See configuration.py for a list of all supported configuration parameters.
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: OAuth2
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with traq.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = star_api.StarApi(api_client)
post_star_request = PostStarRequest(
channel_id="channel_id_example",
) # PostStarRequest | (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# チャンネルをスターに追加
api_instance.add_my_star(post_star_request=post_star_request)
except traq.ApiException as e:
print("Exception when calling StarApi->add_my_star: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
post_star_request | PostStarRequest | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content スターしました。 | - |
400 | Bad Request | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[str] get_my_stars()
スターチャンネルリストを取得
自分がスターしているチャンネルのUUIDの配列を取得します。
- OAuth Authentication (OAuth2):
import time
import traq
from traq.api import star_api
from pprint import pprint
# Defining the host is optional and defaults to https://q.trap.jp/api/v3
# See configuration.py for a list of all supported configuration parameters.
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: OAuth2
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with traq.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = star_api.StarApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# スターチャンネルリストを取得
api_response = api_instance.get_my_stars()
pprint(api_response)
except traq.ApiException as e:
print("Exception when calling StarApi->get_my_stars: %s\n" % e)
This endpoint does not need any parameter.
[str]
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
remove_my_star(channel_id)
チャンネルをスターから削除します
既にスターから削除されているチャンネルを指定した場合は204を返します。
- OAuth Authentication (OAuth2):
import time
import traq
from traq.api import star_api
from pprint import pprint
# Defining the host is optional and defaults to https://q.trap.jp/api/v3
# See configuration.py for a list of all supported configuration parameters.
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure OAuth2 access token for authorization: OAuth2
configuration = traq.Configuration(
host = "https://q.trap.jp/api/v3"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Enter a context with an instance of the API client
with traq.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = star_api.StarApi(api_client)
channel_id = "channelId_example" # str | チャンネルUUID
# example passing only required values which don't have defaults set
try:
# チャンネルをスターから削除します
api_instance.remove_my_star(channel_id)
except traq.ApiException as e:
print("Exception when calling StarApi->remove_my_star: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
channel_id | str | チャンネルUUID |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content 削除されました。 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]