Sending proactive messages to MS teams in a channel - node.js

We are trying to use proactive messages to send notification in a teams channel whenever some activity happens in the backend system. I am using the below code:
await msadapter.continueConversation(convRef, async turnContext => {
await turnContext.sendActivity('proactive hello');
});
in the above code convRef is a reference to conversationReference that is stored into our database. It is obtained when the first time channel is created using a listener on
this.onConversationUpdate(async (context, next: () => Promise<void>) => {
}
The above technique works just fine when i try it in a group chat. But i get authorization error in case of channel as below
[onTurnError] { Error: Authorization has been denied for this request.
at new RestError (/workspace/node_modules/#azure/ms-rest-js/dist/msRest.node.js:1397:28)
at /workspace/node_modules/#azure/ms-rest-js/dist/msRest.node.js:1849:37
at process._tickCallback (internal/process/next_tick.js:68:7)
code: undefined,
statusCode: 401,
request:
WebResource {
streamResponseBody: false,
url:
'https://smba.trafficmanager.net/amer/v3/conversations/19%3A82de560bf7c843b7a6e050fed39db2c5%40thread.tacv2/activities/f%3A48b6e038-a38d-94e3-7907-dcf88ad4484d',
method: 'POST',
headers: HttpHeaders { _headersMap: [Object] },
body:
'{"type":"message","serviceUrl":"https://smba.trafficmanager.net/amer/","channelId":"msteams","from":{"id":"28:a835cf1d-83a8-4ae9-845a-23a68a1df442","name":"FlashCX.ai"},"conversation":{"isGroup":true,"conversationType":"channel","id":"19:82de560bf7c843b7a6e050fed39db2c5#thread.tacv2","tenantId":"04e930f3-0866-4a6d-b07c-a4737e8f9865"},"recipient":{"id":"29:1a-Xb7uPrMwC2XqjMEHCC7ytV2xb2VUCqTA-n_s-k5ZyMCTKIL-ku2XkgbE167D_5ZbmVaqQxJGIQ13vypSqu-A","aadObjectId":"718ab805-860c-43ec-8d4e-4af0c543df75"},"text":"proactive hello hi","inputHint":"acceptingInput","replyToId":"f:48b6e038-a38d-94e3-7907-dcf88ad4484d"}',
query: undefined,
formData: undefined,
withCredentials: false,
abortSignal: undefined,
timeout: 0,
onUploadProgress: undefined,
onDownloadProgress: undefined,
operationSpec:
{ httpMethod: 'POST',
path: 'v3/conversations/{conversationId}/activities/{activityId}',
urlParameters: [Array],
requestBody: [Object],
responses: [Object],
serializer: [Serializer] } },
response:
{ body:
'{"message":"Authorization has been denied for this request."}',
headers: HttpHeaders { _headersMap: [Object] },
status: 401 },
body:
{ message: 'Authorization has been denied for this request.' } }
Doc reference: https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=javascript#send-proactive-message

Related

invalid json response body at http://localhost:8080/auth/admin/realms/RealmName/users reason: Unexpected end of JSON input

user.js:(In keycloak_add_user, i need to get proper response id of the user added in the keycloak. But user is successfully added, but getting this response, so not able to assign role for the user. Please help if any changes required for my code?)
const payload = {
email: req.payload.email,
firstName: req.payload.first_name,
lastName: req.payload.last_name,
credentials: [
{
type: 'password',
temporary: false,
value: req.payload.password,
},
],
enabled: true,
emailVerified: true,
createdTimestamp: Date.now(),
requiredActions: ['UPDATE_PASSWORD'],
};
const token = req.headers.authorization;
const keycloak_add_user = await fetch(
`http://${process.env.KEYCLOAK_HOST}:${process.env.KEYCLOAK_PORT}/auth/admin/realms/${process.env.REALM_NAME}/users`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: token,
},
body: JSON.stringify(payload),
}
);
console.log('keycloak_add_user',keycloak_add_user)
if (keycloak_add_user.status !== 201 || !keycloak_add_user) {
return h
.response({ error: keycloak_add_user.statusText })
.code(keycloak_add_user.status);
}
const keycloak_user = await keycloak_add_user.json();
console.log('keycloak_user', keycloak_user)
response:
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'http://13.213.9.103:8080/auth/admin/realms/Rubick/users',
status: 201,
statusText: 'Created',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}
You need to call a new user GET call after adding user.
The adding user POST call did not response a new user's id. it returned just 201 Created status.
This node java script is example to get new user id.
import fetch from "node-fetch";
const displayUserId = async () => {
const token ='eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5VXBWcTVsQ3Ywc2FZRGNCMHNpOWNscjB2Nmk5aGRPeXAtaS1XQk1ydXJFIn0.eyJleHAiOjE2NTU0Mzc0ODAsImlhdCI6MTY1NTQwMTQ4MCwianRpIjoiOGRjNjM0YjMtNjg4Zi00NWIzLWE5ODItYWVhZDFkNGFiNTU2IiwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MTgwL2F1dGgvcmVhbG1zL3Rlc3QiLCJzdWIiOiI2OTFiMWNkNC1lMzZjLTQ5ZDktOTQ0Zi0yZGZjNjI5MWNlOTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJhZG1pbi1jbGkiLCJzZXNzaW9uX3N0YXRlIjoiYWU2OTBiNjAtMTY5OS00NjAwLThmNDItMTc1NzNiZDllMzUwIiwiYWNyIjoiMSIsInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsInNpZCI6ImFlNjkwYjYwLTE2OTktNDYwMC04ZjQyLTE3NTczYmQ5ZTM1MCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwibmFtZSI6IkZpcnN0TmFtZSBMYXN0TmFtZSIsInByZWZlcnJlZF91c2VybmFtZSI6InVzZXIxIiwiZ2l2ZW5fbmFtZSI6IkZpcnN0TmFtZSIsImZhbWlseV9uYW1lIjoiTGFzdE5hbWUiLCJlbWFpbCI6InVzZXIxQHRlc3QuY29tIn0.bCbAgp3uvbQNCWSXWBX00QJl_zSZmspn0o2Jfejrznlf8ocYxcyWEVG4Cg_aEfqNn0lrdfhllftsZTTJlxrE4F19xg9GSdoya-DsY_fhwvtQZ-gHkxbLwjMqa06eSHxUCxhtk0FNjToxnv_5LSic3z09K9BRi5QXG9peMq_BoLpOjwfbROJHEDvByPtwZpxib6iWeXUl1S8ZwMaW3lJ6bqisbd2GVMJqaVMm0zp9tXws_LOP5lTCWuRKXXWJC0V3Oubd-qN_wQoNw9_R9CNlcVkIrJ3MbZqnEbdczU8-eX5lLnydjVa1eKzo6Rfnh4387vyai80kFPUN2mb4x20xOw';
const got = await fetch('http://localhost:8080/auth/admin/realms/test/users/?username=newmyuser',
{
method: 'GET',
headers: {
'Content-Type' : 'application/json',
Authorization: 'Bearer ' + token
}
}
);
const response = await got.json();
console.log(response);
console.log(response.map(({ id }) => ({ id })))
}
displayUserId();
And it's display a response in terminal.
$ node get-api.js
[
{
id: '70fb1f9f-257d-4f11-8e3d-b0e01bafa47f',
createdTimestamp: 1655395295332,
username: 'newmyuser',
enabled: true,
totp: false,
emailVerified: false,
firstName: 'newFirstName',
lastName: 'newLastName',
email: 'newtestuser#test.com',
disableableCredentialTypes: [],
requiredActions: [],
notBefore: 0,
access: {
manageGroupMembership: true,
view: true,
mapRoles: true,
impersonate: false,
manage: true
}
}
]
[ { id: '70fb1f9f-257d-4f11-8e3d-b0e01bafa47f' } ]
There is no response body, so "invalid json response body" is correct = don't expect JSON response body. There is the Location header (with user id parameter), which is just telling you where you can find the resource.
So if you need user id, then parse Location header or you can pass id in the request payload and Keycloak will use it (or it will return an error if that id is already used).

AWS S3 file upload Get 400 error code while file upload- Pinterest API

I want to create a pin with Pinterest API, So I followed official docs.
So I created a post request with this code snippet:
const options = {
method: 'POST',
url: 'https://pinterest-media-upload.s3-accelerate.amazonaws.com/',
headers: {},
formData: params,
file: {
value: fs.createReadStream(file.location),
options: {
filename: file.name,
},
},
}
request(options, function (error, response) {
if (error) throw new Error(error)
console.log(response)
console.log(response.statusCode)
})
Btw, my options output like that:
{
method: 'POST',
url: 'https://pinterest-media-upload.s3-accelerate.amazonaws.com/',
headers: {},
formData: {
'x-amz-date': '20220214T010341Z',
'x-amz-signature': '784024caf758eae76b1bfb3f61e31aa6ffaed6882867450c6d777ef5f09defa0',
'x-amz-security-token': 'IQoJb3JpZ2luX2VjEDkaCXV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NRTDUzejFhV29qWmpWR2RnKzBvbjVMR0hZcThxRXhZUTNveTRnQXE2d0RUdHpJQkdLRWxPVFhaWUpqZ0xzWDdpbEFSdG0yaS9KdjNNRlRwQ1pGc29hcXpDcUh3c01mY0lVYnlDUjZQS2FkcmlEVTFxell2QmZVbG40S0l0RnZSeE9QSjdTa09kT0JjZm9JcTlPWTdGUkw4YXRsTmg4b21ZOXorSkQyeWs4blVGNjlWbVhqaHROanZVTVFTTFB6akdhbkhnZXV3R2ZKd2JLY2MzMGxOb3B1dzhjQnpXYkdRREZsNjl3UE5iTzBxWEtqUjliVzlNb1BaemhsMWVGVmJtUTk3dTVwYjVKblNLMy9ZRXhKVGUvZ1E0T2dJMjEvVEFXdmVOdjErai9telBtRTFyUWJaMzZIZm4yTlAwUUt1bGtoOFRzbllEUW85QmFmMG1Rb0JxZFUrV0kxZWVJUFV1NCsrOXZpV3NnbVZNWDFoQ3A4UVJCUHdnbitERStsaHZBeDFyb2V3b3hrUUdqNkpYT3Yza29hVi9mK1ZESTJ0Y2pUelo3VnI1bHRzaDFkeWsrNE1QbkpwcEFHT3FZQm9LOFlvVkZLQ2NsSGM0MDhVa1p2UXRUUzRZNlRXbUFoT0hGcEN3MmRTT04xaGp6VVFWRkRYYkRRMnowWVVlZFVCYVdhL056c3BpejlYM0sxZHFZMjNtQ1I0NlVENTdaeU9KMUdqeWZuZk90aHlqd1BmVFh1dklWV0dLZDZvd0U1dlNNRWhyN1dJSWxQc29tMDNMUk1PbVdYVGVqN1JOY0xWM3RDNXo3UVhsZWk2Rm9mbE9sbDBrTkM0dTI5MHdMK09UdFJUMW5CalAzYTlNNnBaOGM2OU9aVkZKM2ZSQT09In1dfQ==',
'x-amz-credential': 'ASIA6QZJ64OPDEAU3F4A/20220214/us-east-1/s3/aws4_request',
'Content-Type': 'multipart/form-data'
},
file: {
value: ReadStream {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
path: '/Users/akasaa101/Desktop/vas-project/social-service/temp/VIIcz8eR6y.mp4',
fd: null,
flags: 'r',
mode: 438,
start: undefined,
end: Infinity,
autoClose: true,
pos: undefined,
bytesRead: 0,
closed: false,
[Symbol(kFs)]: [Object],
[Symbol(kCapture)]: false,
[Symbol(kIsPerformingIO)]: false
},
options: { filename: 'VIIcz8eR6y.mp4' }
}
}
But I get an error as :
'<Error><Code>InvalidArgument</Code><Message>POST requires exactly one file upload per request.</Message><ArgumentName>file</ArgumentName><ArgumentValue>0</ArgumentValue><RequestId>VZ5RH6P8MD14E6CP</RequestId><HostId>loa5iyjv2L3yRHhK0nsu4pIa1VqmvKn9nxgRs2euKlUaZ2mS5Emb0KUGolNeKDu3upY2VPxN8Zo=</HostId></Error>',
By the way, I tried to send the same request with axios but I get a different error.
But now I get an error as "POST requires exactly one file upload per request.".
I checked my options but I cannot find any error on my code snipped.
How can I solve this problem? Please Help!

Can't fetch photo from url javascript

I need to download the photos via urls. I use fetch API. I tried with cors and no-cors.
I guess I don't understand something in 'http' in general (headers or something else).
Here is my code:
const options = {
method: 'GET',
mode: 'cors',
};
fetch('https://artlight.ru/upload/iblock/a47/ART-1013 size13.jpeg', options)
.then((response: any) => {
console.log(response);
response.blob();
})
.then((blob: any) => {
console.log(blob);
})
Whatever I do I get the same response:
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]:
{ body:
PassThrough {
_readableState: [ReadableState],
readable: true,
_events: [Object],
_eventsCount: 6,
_maxListeners: undefined,
_writableState: [WritableState],
writable: true,
allowHalfOpen: true,
_transformState: [Object] },
disturbed: false,
error: null },
[Symbol(Response internals)]:
{ url:
'https://artlight.ru/upload/iblock/a47/ART-1013%20size13.jpeg',
status: 200,
statusText: 'OK',
headers: Headers { [Symbol(map)]: [Object] },
counter: 0 } }
undefined
What should I do to get my blobs? Thanks!
Found axios the very same moment posted here.
This works for me.
path = Path.resolve(__dirname, '../../files', 'check.jpeg');
async download(url: string) {
const response = await Axios({
method: 'GET',
url: url,
responseType: 'stream'
})
response.data.pipe(fs.createWriteStream(this.path));
}

Trying to implement NodeJS Gmail API example

I am trying to get the NodeJs Gmail API Quickstart example working. At first, I was able to get the example running and receive an out put that looked like this.
INBOX
SPAM
ETC ...
I made a few changes after so that I could see messages, etc. Once that happened I started getting the following error after the prompt (It was working prior).
Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify&response_type=code&client_id=***&redirect_uri=***
Enter the code from that page here:
I get this error code
Error retrieving access token GaxiosError: invalid_grant
at Gaxios.<anonymous> (C:\***\node_modules\gaxios\build\src\gaxios.js:73:27)
at Generator.next (<anonymous>)
at fulfilled (C:\***\node_modules\gaxios\build\src\gaxios.js:16:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
response: {
config: {
method: 'POST',
url: 'https://oauth2.googleapis.com/token',
data: 'code=***client_id=***&client_secret=***&redirect_uri=http***=authorization_code&code_verifier=',
headers: [Object],
params: [Object: null prototype] {},
paramsSerializer: [Function: paramsSerializer],
body: 'code=***&client_id=***&client_secret=***&redirect_uri=***&grant_type=authorization_code&code_verifier=',
validateStatus: [Function: validateStatus],
responseType: 'json'
},
data: {
error: 'invalid_grant',
error_description: 'Malformed auth code.'
},
headers: {
***,
***
},
status: 400,
statusText: 'Bad Request'
},
config: {
method: 'POST',
url: 'https://oauth2.googleapis.com/token',
data: 'code=***&client_id=***&client_secret=***&redirect_uri=***=authorization_code&code_verifier=',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'google-api-nodejs-client/3.1.2',
},
params: [Object: null prototype] {},
paramsSerializer: [Function: paramsSerializer],
body: 'code=***&client_id=***&client_secret=***&redirect_uri=***&grant_type=authorization_code&code_verifier=',
validateStatus: [Function: validateStatus],
responseType: 'json'
},
code: '400'
}
So I reverted the changes back to the original quickstart code, and I am still getting the above error. I have no idea why this is happening and would appreciate some help!
the taken of Gmail api expires really soon after you work with it
try to delete the credentials.json and start the script again .

Error when saving to Storage at Google Cloud Function: { Error: Could not refresh access token: Unsuccessful response status code...}

I've written my code some month ago, and now without changing something there is an error message and I don't know why.
My Code in a Google Cloud Function loads a picture from an AWS S3 bucket to google cloud and saves it in a bucket, which was actually working some month ago!
My code is running node.js 8:
const tmpdir = os.tmpdir();
const filePath = path.join(tmpdir, fileName);
console.log(filePath);
console.log(data);
await writeFile(filePath, data.Body);
const bucketName = "test";
console.log('test1');
let storage;
if(!storage){
storage = new Storage();
}
await storage.bucket(bucketName).upload(filePath, {
gzip: false,
metadata: {
cacheControl: "public, max-age=31536000"
}
});
console.log('test2');
console.log(`${filePath} uploaded to ${bucketName}.`);
"test1" is printed in the logs, but "test2" not.
The error I get:
function-138m28l2agh39{ Error: Could not refresh access token: Unsuccessful response status code. Request failed with status code 500
at Gaxios._request (/srv/node_modules/gaxios/build/src/gaxios.js:85:23)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
response:
{ config:
{ url: 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fiam%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control',
headers: [Object],
retryConfig: [Object],
params: [Object],
responseType: 'text',
timeout: 0,
paramsSerializer: [Function: paramsSerializer],
validateStatus: [Function: validateStatus],
method: 'GET' },
data: 'Could not fetch URI /computeMetadata/v1/instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fiam%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control\n',
headers:
{ connection: 'close',
'content-length': '260',
'content-type': 'text/plain; charset=utf-8',
date: 'Thu, 16 Jul 2020 14:25:37 GMT',
'x-content-type-options': 'nosniff' },
status: 500,
statusText: 'Internal Server Error',
request:
{ responseURL: 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fiam%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control' } },
config:
{ url: 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fiam%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform%2Chttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control',
headers: { 'Metadata-Flavor': 'Google' },
retryConfig:
{ noResponseRetries: 3,
currentRetryAttempt: 3,
retry: 3,
httpMethodsToRetry: [Array],
statusCodesToRetry: [Array] },
params:
{ scopes: 'https://www.googleapis.com/auth/iam,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/devstorage.full_control' },
responseType: 'text',
timeout: 0,
paramsSerializer: [Function: paramsSerializer],
validateStatus: [Function: validateStatus],
method: 'GET' },
code: '500' }
Did somebody face a similar issue or can somebody help? :)

Resources