getstream i get chat is not enabled for the organization XXXXXXXX with id XXX - getstream-io

getstream i get chat is not enabled for the organization XXXXXXXX with id XXX when trying to setuser on my applicaation
this.client=new StreamChat(myappisd)
// console.log(this.token)
await this.client.setUser({id:this.$auth.user.id,name:this.$auth.user.first_name},this.token);

Related

How to send message with viber bot to group chat?

Im trying to make a vibe bot that will only send announcements to group of people. The bot will not respond or interact with anyone, as its only and primary task is sending given text as an announcement to a group of people in the same chat.

I don’t understand:

a. What is wrong?
b. Why its not working?
c. Where to find the viber chat id?
d. Can I hook up this bot to any chat group (group/community/channel)?

const ViberBot = require('viber-bot').Bot;
const TextMessage = require('viber-bot').Message.Text;
const viberBot = new ViberBot({
authToken: process.env.VIBER_AUTH_TOKEN,
name: "...name...",
avatar: "...img-url..."
});
viberBot.sendMessage({ id: process.env.VIBER_GROUP_ID }, new TextMessage("hello world!"))
I triple-checked the auth tokens, and it's correct. But I still can't find the Viber Chat Id.
I tried to get the ending of a share link (to use it as the chat id), and the result I got was the following error:
{
status: 10,
status_message: 'webhookNotSet',
chat_hostname: 'SN-CHAT-16_'
}
{
status: 10,
status_message: 'webhookNotSet',
chat_hostname: 'SN-CHAT-20_'
}
{
status: 10,
status_message: 'webhookNotSet',
chat_hostname: 'SN-CHAT-10_'
}
Does anybody know how to fix this?

getting error on associating token in hashgraph/sdk. "publicKey._toProtobufSignature is not a function"

// TOKEN ASSOCIATION WITH ALICE's ACCOUNT
let associateAliceTx = await new TokenAssociateTransaction()
.setAccountId(aliceId)
.setTokenIds([tokenId])
.freezeWith(global.client)
.sign(aliceKey);
//SUBMIT THE TRANSACTION
let associateAliceTxSubmit = await associateAliceTx.execute(global.client);
//GET THE RECEIPT OF THE TRANSACTION
let associateAliceRx = await associateAliceTxSubmit.getReceipt(
global.client
);
//LOG THE TRANSACTION STATUS
console.log(
`- Token association with Alice's account: ${associateAliceRx.status} \n`
);
code is here. I am trying to associate and transfer custom tokens with another user but getting same error for both TokenAssociateTransaction and TransferTransaction. What's the problem here?
Instead of alicKey write PublicKey.fromString(aliceKey)
You have to pass the tokenId which you would associate with Alice's id. Otherwise keep an account that would create a token and pass it to tokenid(ideally it is the NFT collection id, inside the collection, you will get a serial number(token inside NFT)) you can only associate that token and transfer the same.
check the .env file to identify the id which is referring to making this transaction.

how can i request message by using fcm api?

i'm using react native with firebase to use fcm push notification..
this is documnet example
// Node.js
var admin = require('firebase-admin');
// ownerId - who owns the picture someone liked
// userId - id of the user who liked the picture
// picture - metadata about the picture
async function onUserPictureLiked(ownerId, userId, picture) {
// Get the owners details
const owner = admin
.firestore()
.collection('users')
.doc(ownerId)
.get();
// Get the users details
const user = admin
.firestore()
.collection('users')
.doc(userId)
.get();
await admin.messaging().sendToDevice(
owner.tokens, // ['token_1', 'token_2', ...]
{
data: {
owner: JSON.stringify(owner),
user: JSON.stringify(user),
picture: JSON.stringify(picture),
},
},
{
// Required for background/quit data-only messages on iOS
contentAvailable: true,
// Required for background/quit data-only messages on Android
priority: 'high',
},
);
}
document says if i want to request message by using rest api instead of firebase admin
i have to use this url
which is
https://fcm.googleapis.com/fcm/send
but i confused how can i use this url??
and i wonder should i use this url in backend or frontend?
Sending messages to devices through FCM requires that you specify the so-called FCM server key to the API. As its name implies this key should only be used in trusted environments, such as a server you control, your development machine, or Cloud Functions.
There is no secure way to send messages directly from client-side code directly through the FCM API. For more on this, see:
the architectural overview in the Firebase documentation
How to send one to one message using Firebase Messaging

How to retrieve the Stripe fee for a payment from a connected account (Node.js)

I've been reading the documentation for how to retrieve the Stripe fee from a given payment here:
// Set your secret key. Remember to switch to your live secret key in production!
// See your keys here: https://dashboard.stripe.com/account/apikeys
const stripe = require('stripe')('sk_test_xyz');
const paymentIntent = await stripe.paymentIntents.retrieve(
'pi_1Gpl8kLHughnNhxyIb1RvRTu',
{
expand: ['charges.data.balance_transaction'],
}
);
const feeDetails = paymentIntent.charges.data[0].balance_transaction.fee_details;
However I want to retrieve the Stripe fee for a payment made to a connected account. If I try the code above with a payment intent from a linked account I get the error:
Error: No such payment_intent: 'pi_1Gpl8kLHughnNhxyIb1RvRTu'
However, I can actually see the payment intent listed when I receive the posted data from the webhook:
{ id: 'evt_1HFJfyLNyLwMDlAN7ItaNezN',
object: 'event',
account: 'acct_1FxPu7LTTTTMDlAN',
api_version: '2019-02-11',
created: 1597237650,
data:
{ object:
{ id: 'pi_1Gpl8kLHughnNhxyIb1RvRTu',
object: 'payment_intent',
Any tips?
I want to retrieve the Stripe fee for a payment made to a connected
account. If I try the code above with a payment intent from a linked
account I get the error:
In order to retrieve the Stripe fee for a payment made on behalf of a connected account (using a direct Charge) you need to make the retrieve request as the connected account by specifying the special Stripe-Account header in the request. When using stripe-node we'll add that header for you automatically if you pass in the account ID as part of the request options. For example:
const paymentIntent = await stripe.paymentIntents.retrieve(
"pi_1HCSheKNuiVAYpc7siO5HkJC",
{
expand: ["charges.data.balance_transaction"],
},
{
stripeAccount: "acct_1GDvMqKNuiVAYpc7",
}
);
You can read more about making requests on behalf of connected accounts in stripe-node and our other libraries here: https://stripe.com/docs/api/connected_accounts

How to send a private message to user on MSTeams?

I want to send a private message to user. Currently, what I have are:
user id
tenant id
bot
Here is my sample code to try to send message:
var address =
{
channelId: 'msteams',
user: { id: user.id },
channelData: {
tenant: {
id: "cscportal.onmicrosoft.com"
}
},
bot:
{
id: bot.id,
name: bot.name
},
serviceUrl: "https://smba.trafficmanager.net/amer-client-ss.msg/",
useAuth: true
}
var msg = new builder.Message().address(address);
msg.text("Hello! This is a sample message.");
msg.textLocale('en-US');
bot.send(msg);
My sample code does not work because of something wrong in my address. Can you help me to find a way to send a private message to user?
Note: I don't have conversation ID
You need the user’s unique ID and tenant ID to send a proactive message. Typically, these are obtained from a team context, either by fetching the team roster or when a user interacts with your bot in a channel. Please check documentation on how to create personal conversation. Please also read about Proactive Messages.
Here is the source code for Node.js sample for Proactive Messages.

Resources