Bot not Responding Alert in Google Chat API - hangouts-chat

I have used same code as mentioned in one of the samples available on Google Chat Documentation
https://github.com/googleworkspace/hangouts-chat-samples/blob/master/java/basic-async-bot/src/main/java/com/google/chat/bot/basic/async/Bot.java
But the google chat is first giving the message "BOTNAME not responding" then the reply from the bot.
I have even tried to post the message with the thread from previous message as mentioned in the documentation. But still not getting desired result.
Any kind of help will be appreciated.

I eventually got it. Actually, I was sending a response to google chat with some content. When I modified it, by sending a response without any content, the error is resolved and it is working fine as accepted.

it's a shame I didn't see this issue before.
Check your APPSCRIPT.JSON for a chat property {} at the end. With updates when deploying is being overwritten but Google is already solving =)
Ex of my appssript.json: (Correct)
{
"timeZone": "America/Fortaleza",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"libraries": [
{
"userSymbol": "cGoa",
"libraryId": "1v_l4xN3ICa0lAW315NQEzAHPSoNiFdWHsMEwj2qA5t9cgZ5VWci2Qxv2",
"version": "36"
},
{
"userSymbol": "OAuth1",
"libraryId": "1CXDCY5sqT9ph64fFwSzVtXnbjpSfWdRymafDrtIZ7Z_hwysTY7IIhi7s",
"version": "18"
},
{
"userSymbol": "Verificacao_CallBack",
"libraryId": "1dgfE9K71u1k7tkxQHy2F2oAAAYB_lVnZOj8bmL0sl-vMEQYq8bYrDE1J",
"version": "0",
"developmentMode": true
}
]
},
"chat": {
}
}
You can deploys news versions in OLD apps script editors!

Related

How do I fix the problem behind "THIRD_PARTY_AUTH_ERROR" when using Google's API Explorer to send a Firebase Cloud Messaging message?

I am trying to create a very simple Web app that can send and receive messages (including Push notifications) via Firebase Cloud Messaging. I want to try testing the ability to receive test messages sent from the Google API Explorer. However, I am running into a curious error as just about any API call from the relevant API URL will return the following error:
{
"error": {
"code": 401,
"message": "Auth error from APNS or Web Push Service",
"status": "UNAUTHENTICATED",
"details": [
{
"#type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "THIRD_PARTY_AUTH_ERROR"
}
]
}
}
For reference, here is the message that I am trying to send:
{
"message": {
"token": "[FCM_TOKEN]",
"notification": {
"title": "New Notification",
"body": "Sample Text"
}
}
}
I also note that when I add "validate_only": true to the message, that the error goes away and the send request succeeds (though this is of no help, as that disables actually sending the message).
I am stumped, becuse the hint that pops up suggests that my OAuth2 credentials are invalid, though I leave the OAuth2 credential option checked and go through the authorization popup to provide my credentials.
Are you running the web app on Firefox, perhaps?
I have been running around my tail with this same issue for days now, and today I've found that there is an issue on Firefox, while this does work on Chrome:
Similar stack overflow question
The issue on the Firebase repository on Github
Although not a proper answer, I hope this helps.

Firebase Cloud Messaging Reports - not displaying sent count in Reports

We have set "analytics_label" in the message as stated in the documentation and the message is getting delivered as well. But we do not see any entry in the report. Please check our message string and let us know what might be wrong. Appreciate your help.
REST API being called
https://fcm.googleapis.com/fcm/send
Message being sent
{"topic":"81xxxxx42","android":{"priority":"high"},"priority":"high","fcm_options":{"analytics_label":"nwy81xxxxx42"},"data":{"MID":-1,"frm":"99xxxxx32","MTP":9,"msg":""}}
I'm not certain what library you're using or if you're just POSTing directly to the REST API, but looking at code that I know works I think you just need to make fcm_options and analytics_label camel case.
{
"topic": "81xxxxx42",
"android": {
"priority": "high"
},
"priority": "high",
"fcmOptions": {
"analyticsLabel": "nwy81xxxxx42"
},
"data": {
"MID": -1,
"frm": "99xxxxx32",
"MTP": 9,
"msg": ""
}
}

YouTube Data API V3 not returning Livestream from Channel ID

I'm working on a project that requires me to get a YouTube live stream's chat for use in my program. Everything was working perfectly with this js package, but it seems that google has changed something because it suddenly stopped working. I have regenerated keys, and am well below my quota, so I know that isn't the problem.
Strangely, when I use the youtube data api "try this api" section in their online documentation, the same problem is happening where the live stream is not found by the id. I've tried it on many different live channels, and all have returned an empty "items" array. Anyone else have this issue?
function execute() {
return gapi.client.youtube.search.list({
"part": "snippet, id",
"channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
"eventType": "live",
"type": "video"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
Results from the request:
{
"kind": "youtube#searchListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
"regionCode": "US",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}
I can confirm this issue but the issue is a bug from Google. Hope it gets fixed soon.
There is definitely something going on with the YouTube Data API. If you give it a try on the on the Deverloper Console for Search: list it won't work if you are providing channelId. However, if you leave channelId blank it will return all of YouTube's live streams.
Google's instructions for getting help say to add the tag google-apis-explorer to your post. I have submitted an edit to add that tag to your original post. Hopefully we'll all get some answers soon.

How to get rid of default_intent in wit.ai

Following is the response for my simple application. I expected it to have an intent as open_screen but it shows the intent as default_intent. where did I made the error.
{
"entities":{
"screen_name":[
{
"confidence":0.9928150760384576,
"start":10,
"end":27,
"body":"inventory console",
"value":{
"value":"inventory console"
},
"entity":"screen_name"
}
]
},
"confidence":null,
"_text":"lets open inventory console",
"intent": "default_intent",
"intent_id": "57bb1f3b-3098-4a17-a0d1-8d41e0"
Thanks for sharing. Do you have a new app (with Stories) or an old app? In the new apps, intent are now trait entities. This is why you may see a "default_intent", but if you use the latest version of the app, it should disappear.

How to get the original message's message field through FbGraph /me/inbox?

I am trying to get the original message content from the /me/inbox through the API. I have authorized the read_inbox permission and got a bunch of message objects back. However, each of the message has no Subject nor Message (content). But it does contain comments which include a list of comments with the comment's message content.
Is this a permission issue? Or am I using the API wrong?
Message example below (using fake content for privacy reason.)
{
"id": "97654321",
"to": {
"data": [
{
"name": "Luke C.",
"id": "12346"
},
{
"name": "Mark D.",
"id": "12345"
}
]
},
"updated_time": "2013-01-31T19:10:17+0000",
"unread": 0,
"unseen": 0
}
Upon asking my colleague who have worked with FBgraph api for sometime already. It seems like the fbgraph inbox does behaved like this for a while and there does not seem to have any intention to fix it. And I also noticed that the me/outbox would behave as expected where a 'from'
Thus, I have moved onto using FQL to replace the me/inbox api:
SELECT body, recipients, sender, thread_id, message_id
FROM unified_message where thread_id IN
(SELECT thread_id FROM unified_thread WHERE folder = 'inbox')
If anyone know why FbGraph api does not work, please still help contribute to this question.