Reputation: 1
I'm having trouble retrieving the snippet.messageDeletedDetails from the YouTube Live Streaming API.
API Documentation Review: I thoroughly went through the official documentation provided by YouTube regarding the Live Streaming API. Unfortunately, I couldn't find detailed information or examples related to retrieving snippet.messageDeletedDetails.
Code Implementation: I implemented the standard API request to retrieve messages from a live chat, which includes the snippet object. However, the messageDeletedDetails field is not being returned in the response.
Here's a snippet of the code I'm using:
import google_auth_oauthlib.flow
import googleapiclient.discovery
import googleapiclient.errors
scopes = ["https://www.googleapis.com/auth/youtube.force-ssl"]
# Disable OAuthlib's HTTPS verification when running locally.
# *DO NOT* leave this option enabled in production.
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
api_service_name = "youtube"
api_version = "v3"
client_secrets_file = "crab_secret_desk.json"
# Get credentials and create an API client
flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(
client_secrets_file, scopes)
credentials = flow.run_console()
youtube = googleapiclient.discovery.build(
api_service_name, api_version, credentials=credentials)
request = youtube.liveChatMessages().list(
liveChatId=foundChatID,
part="snippet,authorDetails",
)
response = request.execute()
print(response)
The response does not show "messageDeletedDetails" even though there are deleted messages. Strangely though, the total results doesn't go down even when a message is deleted.
I've double-checked the API documentation and made sure that my API key has the necessary permissions. I've also tried different approaches, such as including snippet.messageDeletedDetails in the part parameter of the request, but to no avail.
Has anyone encountered a similar issue with retrieving snippet.messageDeletedDetails from the YouTube Live Streaming API?
Upvotes: 0
Views: 26