youtube.liveChatMessages.list API Explorer - youtube-data-api

I try list messages from LiveChat of YouTube. Request:
GET https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=Qfad59EnhUA&part=snippet&key={YOUR_API_KEY}
Response:
404 Not Found
{
"error": {
"errors": [
{
"domain": "youtube.liveChat",
"reason": "liveChatNotFound",
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
],
"code": 404,
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
}
Pages https://www.youtube.com/live_chat?is_popout=1&v=Qfad59EnhUA and
https://www.youtube.com/watch?v=Qfad59EnhUA exist.
What's wrong?

i decide this problem. liveChatId can be get from broadcast for python:
print '%s' % (broadcast['snippet']['liveChatId'])

Related

Google API Get event - Not Found

I am trying to to get event resource using the following api
https://www.googleapis.com/calendar/v3/calendars/primary/events/eventId.
However, I am receiving 404 Not Found response, eventId is correct, I've checked it many times. Also, I've tried to call same method from their website (https://developers.google.com/calendar/api/v3/reference/events/get) and still receiving same error. You can find the attached screenshot here.
API Response Body :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
404 Not Found means just that not found.
The event.get method takes a event id as a parameter.
The user you are authencation with needs to have permission to access that event your its going to return a 404 not found for that user.
Try doing an events.list first for the calendar to get a list of all valid events for that calendar if it also returns a 404 then the problem would be that the user does not have access to that calendar.

Google APi Bad Request

i try to implement Passes service of Google Api in our website but we always have error 400 problem
we follow this documentation
Giftcardclass: insert
i use postman for test
POST https://www.googleapis.com/walletobjects/v1/giftCardClass
Request body
{
"kind":"walletobjects#loyaltyObject",
"id":"test2.test",
"classId":"test.test",
"version":12,
"state":"active",
"issuername":"dsadasdasdas",
"barcode":{
"kind":"walletobjects#barcode",
"type":"ean13",
"value":"aaaa",
"alternateText":"aaaa"
}
}
jSon response
{ "error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request" }
}
from the documentation seems that only id,issuerstate and reviewStatus are required.
Looks like your ids are formatted wrongly, it should be issuer_id.unique_id. See https://developers.google.com/pay/passes/rest/v1/giftcardclass#GiftCardClass.FIELDS.id for reference.

user.messages.get responding invalid ID

when attempting to test out the api explorer for user.messages: get I have been getting an invalid message ID response.
I am getting the message ID from a recent email in my inbox sent to me, and removed the <> from either ends.
response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid id value"
}
],
"code": 400,
"message": "Invalid id value"
}
}
I am a bit confused as I am using the powershell module gshell and noticed that the same messageID worked in my commands but returned invalid id value in the api explorer.
edit: if I do a inbox search for rfc822msgid:[messageID] it returns the correct message
First you have to call the users.messages.list api. It will give a list of messageids. Then we have to call users.message.get api with each messageid to fetch the mail content. You can query the mails with advanced search options provided by Gmail API.
You should not use the rfc822msgid, but the Gmail API message id. Try to list messages and use the id you get from that when getting the message.

Getting 403() error while using google Youtube API

I am gating this Error when i use Youtube API
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=************"
}
],
"code": 403,
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
}
}
and 403() error it's showing in console

google enterprise license manager api - Unauthorized operation for the given domain

The LicenseAssignments.get api returns 200 OK
Request:
GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>
Response:
200 OK
- Show headers -
{
"kind": "licensing#licenseAssignment",
"selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>",
"userId": "<email>",
"productId": "Google-Apps",
"skuId": "Google-Apps-For-Business"
}
However LicenseAssignments.listForProduct returns "403 Forbidden"
Request:
GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=my_customer
Response:
403 Forbidden
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Unauthorized operation for the given domain."
}
],
"code": 403,
"message": "Unauthorized operation for the given domain."
}
}
Any idea why I get 403 forbidden for the second request?
This issue got resolved when I used 'domain name' (e.g. something.com) as 'customerId'. This is different from the usual behavior of other Google APIs where 'customerId' is 'my_customer'.
https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=<domain name>

Resources