Create google chat space using api from postman - google-chat-api

\`Hi,
I am trying to create a space in google chat using api. So, for this I have configured OAuth2.0 and following details.Method: spaces.create" post methodHTTP Request: "https://www.googleapis.com/auth/chat.spaces.create"Authorization Scopes: "https://www.googleapis.com/auth/chat.spaces.create"I could able to generate the access token but I am not sure about request body however I configured as follows:
*{
"name": "POC Test SPACE",
"spaceType": "DIRECT_MESSAGE",
"singleUserBotDm": "false",
"threaded": "false",
"displayName": ""
}
For this the response as follows:
"error": {
"code": 404,
"message": "Method not found.",
"status": "NOT_FOUND"
}
Actually our requirement is to send notifications on google chat using gmail id in place of sending emails.
Can anyone please suggest where/what I am missing or do I need to do in another way !!!
Regards,
Vamshi.

per this article you have to be a member of the developer preview program to have access to this feature.
https://developers.googleblog.com/2022/05/Create%20Spaces%20and%20Add%20Members%20with%20the%20Google%20Chat%20API.html

Related

Is that possible to add android app to firebase project programmatically using firbase cloud function

Is there any method to add a android app to exiting firebase project programmatically and i need the google-services.json as result then i need to add sha key with that same app using node-js
online documentation not solve my problem or i don't understand how to do it from that documentation
Thankyou for your answer i flowed it and facing another issue
#admin and #Frank van Puffelen please check
when i try to create android it showing this error.
{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT" } }
I send post request from live api test window
and in parent i set it as `projects/343202254462`
{ "displayName": "testing", "name": "te4sting", "packageName": "io.asdasd.fdsfdsf", "projectId": "324324324", "appId": "wdeqwe" }
There is a REST api, Firebase Management API, which lets you control the apps connected and other such admin work. Friendly note, make sure you restrict all client api keys from using this api!
REST Resource: v1beta1.projects.androidApps
create POST /v1beta1/{parent=projects/*}/androidApps

Rest API request for Google Translation API

I have a problem with Rest API request for Google Translation API
My POST method is https://translation.googleapis.com/language/translate/v2?key=MY_KEY
But I get an error
{
"error": {
"code": 400,
"message": "API Key not found. Please pass a valid API key.",
"errors": [
{
"message": "API Key not found. Please pass a valid API key.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
Please help me to understand where the problem comes from.
You might want to try starting with one of the samples as opposed to trying to build your own client library or get/POST with REST. If you must use REST, the following example may be helpful:
https://translation.googleapis.com/language/translate/v2?key=your-key-here&q=cheese&target=es
Replace the API key with the one that you have enabled access to the translate API on.

Bot work perfect on emulator but not in any channel

I wrote a bot using Bot Connector REST API from Microsoft Bot Framework and tested it via Bot Framework Emulator V3.5.25 on localhost and remotely with app id and app password, it work just perfect; but using Skype channel i can receive message on my endpoint but bot´s answer never reach to Skype user.
Incoming message from Skype user
{
"text": "Hello bot?",
"type": "message",
"timestamp": "2017-03-03T19:08:30.988Z",
"id": "1488568110992",
"channelId": "skype",
"serviceUrl": "https://smba.trafficmanager.net/apis/",
"from": {
"id": "29:1rILOvqsAlldnM1C4nK30sdjpveZezKC9LX5yYAvyi_k",
"name": "Skype User"
},
"conversation": {
"id": "29:1rILOvqsAlldnM1C4nK30sdjpveZezKC9LX5yYAvyi_k"
},
"recipient": {
"id": "28:e20620eb-b214-4b02-8de1-c7fd14c11005",
"name": "My_bot"
},
"entities": [{
"locale": "es-ES",
"platform": "Windows",
"type": "clientInfo"
}]
}
Outgoing message from my bot
{
"type": "message",
"text": "Bot is Ok",
"replyToId": "1488568110992",
"locale": "es",
"channelId": "skype",
"serviceUrl": "https://smba.trafficmanager.net/apis/",
"from": {
"id": "28:e20620eb-b214-4b02-8de1-c7fd14c11005",
"name": "My_bot"
},
"conversation": {
"id": "29:1rILOvqsAlldnM1C4nK30sdjpveZezKC9LX5yYAvyi_k"
},
"recipient": {
"id": "29:1rILOvqsAlldnM1C4nK30sdjpveZezKC9LX5yYAvyi_k",
"name": "Skype User"
}
}
I don't receive a json payload response from the Bot Framework just this status: 400 Bad Request. Just for test purposes my bot sent a response with some missing parameters and the Bot Framework response with the same status and a json payload with an error message code and text.
I did not publish my bot, but according to Bot Framework docs, is not necessary.
I´m missing something? Anybody have an idea?
Thanks in advance.
Yes, it is not required to be published for the skype bot to work. I'd like to suggest you few checkpoints and check if you have already tried them:
The Bot Framework Developer Portal contains a test panel where you can test the connection from the Bot Connector service to your bot. The security model used by the Bot Connector differs slightly from the security model used by the Emulator, and this is the most realistic step in testing your bot’s authentication.
Follow these steps to test your bot in the cloud with security enabled:
Make sure your bot is deployed and running
Log in to the Bot Framework Developer Portal, click on “My bots,” and if necessary, select the bot you want to debug from the list.
Locate the test panel in the bottom-left corner of the screen and click the blue “Test” button. The results of the test appear just below the button.
Please check the status of your bot on Skype Developer Portal.
If the bot has status Pending Review. It looks like that bot will not work while the status is in "Pending Review". Check this screenshot.
The bot is successfully registered only if it looks like this before publishing.
Let me know in details if you still have any issues.
Thanks
-Jyo
Sorry, the problem is solved.
The bearer scheme was in bad format, instead of Bearer, had bearer.
Changed that and everything work.
Really sorry.

How to authenticate WooCommerce REST API

I have generated the consumer key and consumer secret but I don't know how to aply it to authenticate on Postman. This is the screenshot below:
The url looks like this: https://mystore.com/wp-json/wc/v1/coupons?oauth_consumer_key=ck_XXXXXXXXXXXXXXX&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1471440398&oauth_nonce=Qaq8cK&oauth_version=1.0&oauth_signature=XXXXXXXXXXXXXXXXXXXXXXXXXw=
But this is returning error 401:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
I have read the the documentation but it didn't show any examples.
You can send your credentials via Authentication header if your site runs on HTTPS (it should if you're running WooCommerce).
Here's the relevant part of the docs:
https://woothemes.github.io/woocommerce-rest-api-docs/?shell#authentication-over-https

Meteor Google Calendar Push notification "Unauthorized WebHook callback channel"

I want to use google calendar notification.
I have deployed my Meteor application to
https://google-push-notification.meteor.com
I have verified the url in google web master.
Added the same domain to Domain Verification of Google Console.
I have created Meteor rest api of https://google-push-notification.meteor.com/api/articles for get and post method both.
Below is the postman collection of apis. https://www.getpostman.com/collections/106be7c94d35fcbdb0f8
Post https://www.googleapis.com/calendar/v3/calendars/abc#gmail.com/events/watch
Authorization: Bearer ya29.YwJdqjlSv8Tkl5MEJgiVXQPGxE24ZfITuf8gt0C8DO_VHDvB_1mRAgpAx64R6Wpw8I6fiw
Content-Type: application/json
{
"id": "ya29.XwI-RJ54rS3dbRHgak8V_iTuV7uAWJoZfRFnUE76uCIIUbw4eILPsdEME56Jm5_EfDtWWWs",
"type": "web_hook",
"address": "https://google-push-notification.meteor.com/api/items"
}
I am getting the following response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://google-push-notification.meteor.com/api/articles"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://google-push-notification.meteor.com/api/articles"
}
}
Why am I getting push.webhookUrlUnauthorized response even when I have verified my site in google and added the same domain in google console.
Can anyone please help us to solve the issue
According to the google forum, make sure you have validate the following items below:
Please make sure to follow the steps to correctly verify that the domain indeed belongs to you here: https://support.google.com/webmasters/answer/35179
It must be a https endpoint and the same endpoint must also be present in the developer console as per instructions here: https://developers.google.com/google-apps/calendar/v3/push#registering
Hope this resolve your issue. Cheers!

Resources