i don't get when meeting schedule in calendly webhook - calendly

I get this request in my webhook. there is no field which like which time meeting schedule. ( I have changed some private data )
{
created_at: '2022-03-28T11:51:16.000000Z',
created_by: 'https://api.calendly.com/users/AAAAAAAAAAA',
event: 'invitee.created',
payload: {
cancel_url: 'https://calendly.com/cancellations/VVVVVVVV',
created_at: '2022-03-28T11:51:16.669509Z',
email: 'test#gmail.com',
event: 'https://api.calendly.com/scheduled_events/AAAAAAA',
first_name: null,
last_name: null,
name: 'test#gmail.com',
new_invitee: null,
old_invitee: null,
payment: null,
questions_and_answers: [],
reschedule_url: 'https://calendly.com/reschedulings/BBBBBBBBB',
rescheduled: false,
status: 'active',
text_reminder_number: null,
timezone: 'Asia/Calcutta',
tracking: {
utm_campaign: null,
utm_source: null,
utm_medium: null,
utm_content: null,
utm_term: null,
salesforce_uuid: null
},
updated_at: '2022-03-28T11:51:16.669509Z',
uri: 'https://api.calendly.com/scheduled_events/BBBBB/invitees/AAAAAA'
}

To retrieve the event's start time you'll need to send a request to the event uri included in the webhook payload (https://api.calendly.com/scheduled_events/AAAAAAA). The response to this request will include a start_time value.

Related

Why does Array.push not work on arrays with Vuelidatevalidations?

I have multiple formArrays inside a form variable. On adding vuelidate validations to these formArrays/collections, Array.push doesn't work properly.
FormArray and Form Data
data() {
return {
form: {
experience: [{
employerName: '',
department: '',
from: null,
to: null,
tillDate: false,
type: null,
noOfYears: null,
noOfMonths: null,
other: null,
}],
name: '',
email: '',
phone: null,
course: null,
Vuelidate validation rules
validations: {
form: {
experience: {
$each: {
type: {
requiredIf: requiredIf(function() {
return this.openExperience;
}),
},
other: {
requiredIf: requiredIf((obj) => obj.type === 'Other'),
},
noOfMonths: {
minValue: minValue(0),
maxValue: maxValue(11),
},
noOfYears: {
minValue: minValue(0),
},
},
},
name: {
required,
},
email: {
email,
},
phone:{
numeric
},
dateOfBirth: {
maxValue(val){
return this.$dateFns.sub(new Date(),{years: 18}) > new Date(val);
}
},
},
},
Function to add formArray
addExperience(){
this.form.experience.push({
employerName: '',
department: '',
from: null,
to: null,
tillDate: false,
type: null,
noOfYears: null,
noOfMonths: null,
other: null,
});
const length = 'experience' + (this.form.experience.length-2).toString();
document.getElementById(length).scrollIntoView();
},
I tried removing the vuelidate rules and it worked as expected. Screen Recording
I had a computed property named 'open'. In the getter for the property, I clear the entire form for a specific condition. It turns out that adding another formGroup (Array.push) to the formArray would end up invoking all the computed properties, and in turn, calling the getter for 'open' and clearing the form.
I ended up moving the code block in the computed property getter to the mounted life-cycle hook and it works fine now.

Error creating discussion forum in D2L linked with topic or module using REST API

Below api is correct for creating discussion forum in module or wrong
API Endpoint: < domain >/d2l/api/le/1.63/< orgUnitId >/content/modules/< moduleId >/structure/
Payload: {
"TopicType": 0,
"Url": "",
"StartDate": null,
"EndDate": null,
"DueDate": null,
"IsHidden": false,
"IsLocked": false,
"OpenAsExternalResource": null,
"Title": "Add a Discussion Forum",
"ShortTitle": "DIS_FOR-02",
"Type": 1,
"Description": null,
"ParentModuleId": < moduleId >,
"ActivityId": 1,
"Duration": null, // Available in LE's unstable contract
"IsExempt": false,
"ToolId": null,
"ToolItemId": null,
"ActivityType": 5,
"GradeItemId": null,
"LastModifiedDate": null
}
Response:
{
"Errors": []
}
I am not getting any information in response so not getting what's the issue in that

My updated Azure App Services web app is not served after a successful deploy. How do I fix that?

I built a working node.js Express app using the tutorial "Deploy Express.js to Azure App Service using Visual Studio Code", see:
https://learn.microsoft.com/en-us/azure/developer/javascript/tutorial/deploy-nodejs-azure-app-service-with-visual-studio-code?tabs=bash.
This first version was deployed and worked successfully using only Get requests.
I made some minor changes to include Post requests and deployed that update. This takes 18 minutes to deploy, but the new version is not served to my browser, just the old version. Going to my Azure dashboard and clicking my app service and selecting Browse there, it still shows the old version 2 days after the successful update deploy.
Another problem is that after a long time, say overnight, a request to the app's api does not get answered. My Safari browser says the server stopped responding. But a second request immediately after does get a response, but still with the same old version.
This JSON file may be useful.
{
"id": "/subscriptions/3603adff-9823-408c-980c-ea71f06376ce/resourceGroups/AcesTraderExpress-rg/providers/Microsoft.Web/sites/AcesTraderExpress",
"name": "AcesTraderExpress",
"type": "Microsoft.Web/sites",
"kind": "app,linux",
"location": "East US",
"properties": {
"name": "AcesTraderExpress",
"state": "Running",
"hostNames": [
"acestraderexpress.azurewebsites.net"
],
"webSpace": "AcesTraderExpress-rg-EastUSwebspace-Linux",
"selfLink": "https://waws-prod-blu-217.api.azurewebsites.windows.net:454/subscriptions/3603adff-9823-408c-980c-ea71f06376ce/webspaces/AcesTraderExpress-rg-EastUSwebspace-Linux/sites/AcesTraderExpress",
"repositorySiteName": "AcesTraderExpress",
"owner": null,
"usageState": 0,
"enabled": true,
"adminEnabled": true,
"enabledHostNames": [
"acestraderexpress.azurewebsites.net",
"acestraderexpress.scm.azurewebsites.net"
],
"siteProperties": {
"metadata": null,
"properties": [
{
"name": "LinuxFxVersion",
"value": "NODE|14-lts"
},
{
"name": "WindowsFxVersion",
"value": null
}
],
"appSettings": null
},
"availabilityState": 0,
"sslCertificates": null,
"csrs": [],
"cers": null,
"siteMode": null,
"hostNameSslStates": [
{
"name": "acestraderexpress.azurewebsites.net",
"sslState": 0,
"ipBasedSslResult": null,
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"toUpdateIpBasedSsl": null,
"ipBasedSslState": 0,
"hostType": 0
},
{
"name": "acestraderexpress.scm.azurewebsites.net",
"sslState": 0,
"ipBasedSslResult": null,
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"toUpdateIpBasedSsl": null,
"ipBasedSslState": 0,
"hostType": 1
}
],
"computeMode": null,
"serverFarm": null,
"serverFarmId": "/subscriptions/3603adff-9823-408c-980c-ea71f06376ce/resourceGroups/AcesTraderExpress-rg/providers/Microsoft.Web/serverfarms/AcesTraderExpress-plan",
"reserved": true,
"isXenon": false,
"hyperV": false,
"lastModifiedTimeUtc": "2021-11-24T21:28:18.1666667",
"storageRecoveryDefaultState": "Running",
"contentAvailabilityState": 0,
"runtimeAvailabilityState": 0,
"siteConfig": {
"numberOfWorkers": 1,
"defaultDocuments": null,
"netFrameworkVersion": null,
"phpVersion": null,
"pythonVersion": null,
"nodeVersion": null,
"powerShellVersion": null,
"linuxFxVersion": "NODE|14-lts",
"windowsFxVersion": null,
"requestTracingEnabled": null,
"remoteDebuggingEnabled": null,
"remoteDebuggingVersion": null,
"httpLoggingEnabled": null,
"azureMonitorLogCategories": null,
"acrUseManagedIdentityCreds": false,
"acrUserManagedIdentityID": null,
"logsDirectorySizeLimit": null,
"detailedErrorLoggingEnabled": null,
"publishingUsername": null,
"publishingPassword": null,
"appSettings": null,
"metadata": null,
"connectionStrings": null,
"machineKey": null,
"handlerMappings": null,
"documentRoot": null,
"scmType": null,
"use32BitWorkerProcess": null,
"webSocketsEnabled": null,
"alwaysOn": false,
"javaVersion": null,
"javaContainer": null,
"javaContainerVersion": null,
"appCommandLine": null,
"managedPipelineMode": null,
"virtualApplications": null,
"winAuthAdminState": null,
"winAuthTenantState": null,
"customAppPoolIdentityAdminState": null,
"customAppPoolIdentityTenantState": null,
"runtimeADUser": null,
"runtimeADUserPassword": null,
"loadBalancing": null,
"routingRules": null,
"experiments": null,
"limits": null,
"autoHealEnabled": null,
"autoHealRules": null,
"tracingOptions": null,
"vnetName": null,
"vnetRouteAllEnabled": null,
"vnetPrivatePortsCount": null,
"publicNetworkAccess": null,
"cors": null,
"push": null,
"apiDefinition": null,
"apiManagementConfig": null,
"autoSwapSlotName": null,
"localMySqlEnabled": null,
"managedServiceIdentityId": null,
"xManagedServiceIdentityId": null,
"keyVaultReferenceIdentity": null,
"ipSecurityRestrictions": null,
"scmIpSecurityRestrictions": null,
"scmIpSecurityRestrictionsUseMain": null,
"http20Enabled": false,
"minTlsVersion": null,
"scmMinTlsVersion": null,
"ftpsState": null,
"preWarmedInstanceCount": null,
"functionAppScaleLimit": 0,
"healthCheckPath": null,
"fileChangeAuditEnabled": null,
"functionsRuntimeScaleMonitoringEnabled": null,
"websiteTimeZone": null,
"minimumElasticInstanceCount": 0,
"azureStorageAccounts": null,
"sitePort": null
},
"deploymentId": "AcesTraderExpress",
"slotName": null,
"trafficManagerHostNames": null,
"sku": "Free",
"scmSiteAlsoStopped": false,
"targetSwapSlot": null,
"hostingEnvironment": null,
"hostingEnvironmentProfile": null,
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"clientCertMode": 0,
"clientCertExclusionPaths": null,
"hostNamesDisabled": false,
"domainVerificationIdentifiers": null,
"customDomainVerificationId": "32CA73F9034F12CA2A538C5F30E96A3BDF81DFD04981F8BFE65F69C4E24A69E6",
"kind": "app,linux",
"inboundIpAddress": "20.49.104.15",
"possibleInboundIpAddresses": "20.49.104.15",
"ftpUsername": "AcesTraderExpress\\$AcesTraderExpress",
"ftpsHostName": "ftps://waws-prod-blu-217.ftp.azurewebsites.windows.net/site/wwwroot",
"outboundIpAddresses": "40.76.167.202,52.146.70.44,52.146.70.103,52.146.68.209,52.146.68.246,52.146.69.57,20.49.104.15",
"possibleOutboundIpAddresses": "40.76.167.202,52.146.70.44,52.146.70.103,52.146.68.209,52.146.68.246,52.146.69.57,52.146.70.115,52.146.70.118,52.146.70.158,52.146.66.148,52.146.71.5,40.76.165.150,40.76.167.156,40.76.167.157,52.146.68.142,52.146.64.68,52.146.65.22,52.146.65.23,52.191.239.27,52.191.239.78,52.191.239.120,52.224.200.31,52.224.201.90,52.224.202.78,20.49.104.15",
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"suspendedTill": null,
"siteDisabledReason": 0,
"functionExecutionUnitsCache": null,
"maxNumberOfWorkers": null,
"homeStamp": "waws-prod-blu-217",
"cloningInfo": null,
"hostingEnvironmentId": null,
"tags": null,
"resourceGroup": "AcesTraderExpress-rg",
"defaultHostName": "acestraderexpress.azurewebsites.net",
"slotSwapStatus": null,
"httpsOnly": false,
"redundancyMode": 0,
"inProgressOperationId": null,
"geoDistributions": null,
"privateEndpointConnections": [],
"buildVersion": null,
"targetBuildVersion": null,
"migrationState": null,
"eligibleLogCategories": "AppServiceAppLogs,AppServiceAuditLogs,AppServiceConsoleLogs,AppServiceHTTPLogs,AppServiceIPSecAuditLogs,AppServicePlatformLogs,ScanLogs",
"storageAccountRequired": false,
"virtualNetworkSubnetId": null,
"keyVaultReferenceIdentity": "SystemAssigned"
}
}
I am following this website. Initially I am added only Get request and deployed to azure portal using this doc Deploy Node.js Express.js to App Service from Visual Studio Code - Azure | Microsoft Docs.
(Note: Skipped the Local git deployment process).
Directly deployed using Deploy to Web app in Visual Studio Code
Then, I am adding the below code in visual studio with Post Request
Add below code in app.js
const express = require("express");
const port = process.env.PORT || 3000
const bodyParser = require("body-parser")
// App using express node module
const app = express();
app.use(bodyParser.urlencoded({
extended:true
}));
// Get request
app.get("/", function(req, res) {
res.sendFile(__dirname + "/index.html");
});
// Post Request
app.post("/", function(req, res) {
var num1 = Number(req.body.num1);
var num2 = Number(req.body.num2);
var result = num1 + num2 ;
res.send("Addition - " + result);
});
app.listen(port, function(){
console.log('server is running on port 3000');
})
Added the below code in index.html
< !DOCTYPE html>
< html lang="en" dir="ltr">
< head>
< meta charset="utf-8">
< title>Calculator</title>
< /head>
< body>
< h1>Simple Calculator.< /h1>
< form action="/" method="post">
< input type="text" name="num1" placeholder="First Number">
< input type="text" name="num2" placeholder="Second Number">
< button type="submit" name="submit">
calculator
< /button>
< /form>
< /body>
< /html>
After added Post Method request, I was deployed again in a Azure Web App. (By Default it was deployed in Linux app service).
I can view the results in Browser

Using Stripe webhooks with graphql-yoga and Prisma

I'm having some trouble finding how to intercept Stripe webhook calls in my application. I use graphql-yoga (express) and prisma.
I have to listen to payment failure calls from Stripe so I can edit the corresponding user profile.
Thanks for the help!
Stripe webhook calls look like so :
{
"created": 1326853478,
"id": "charge.expired_00000000000000",
"type": "charge.expired",
"object": "event",
"request": null,
"pending_webhooks": 1,
"data": {
"object": {
"id": "ch_00000000000000",
"object": "charge",
"amount": 100,
"captured": false,
"created": 1537153592,
"currency": "usd",
"customer": null,
"description": "My First Test Charge (created for API docs)",
"invoice": null,
"livemode": false,
"on_behalf_of": null,
"order": null,
"outcome": null,
"paid": true,
"receipt_email": null,
"receipt_number": null,
"refunded": false,
"review": null,
"shipping": null,
"source": {
"id": "card_00000000000000",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": "12919",
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_00000000000000",
"cvc_check": null,
"name": null,
"tokenization_method": null
},
"statement_descriptor": null,
"status": "succeeded",
}
}
}
Since Stripe Webhook returns a generic http POST with JSON payload, it will not format the event data according to Graphql language query.
For now, what you can do is to expose a normal REST API endpoint using Graphql-Yoga's express[0]
I have composed a working sample code you can try it out
const { GraphQLServer } = require('graphql-yoga')
const typeDefs = `
type Query {
hello(name: String): String!
}
`
const resolvers = {
Query: {
hello: (_, { name }) => `Hello ${name || 'World'}`,
},
}
const server = new GraphQLServer({ typeDefs, resolvers, skipValidation: true })
server.express.use('/api/stripe/webhooks', (req, res) => {
// Handle your callback here !!!!
res.status(200).send();
})
server.start(() => console.log('Server is running on localhost:4000'))
Let me know if the above helps.
[0] https://github.com/prisma/graphql-yoga#how-to-eject-from-the-standard-express-setup

How to write the SQL query below mention table structure and JSON output using FOR JSON

How to write the SQL query below mention table structure and JSON output using FOR JSON.
table structure
CREATE TABLE [dbo].[TreeView](
[AuditId] [int] NOT NULL,
[Id] [int] NOT NULL,
[FatherId] [int] NULL,
[MotherId] [int] NULL,
[EnglishName] [varchar](500) NULL,
[Description] [nchar](10) NULL,
[Image] [varchar](500) NULL,
JSON output
{ id: 1, title: "Meera Mohaideen", description: "", image: "demo/images/photos/m.png" },
{ id: 2, title: "Rahman Beevi", description: "", image: "demo/images/photos/f.png" },
{ id: 3, title: "Abdul Jabbar", description: "", image: "demo/images/photos/m.png" },
{ id: 4, title: "Jahabar Natchiyal", description: "", image: "demo/images/photos/f.png" },
{ id: 5, parents: [1,2] ,title: "AJhir Ali", description: "", image: "demo/images/photos/m.png" },
{ id: 6, parents: [3, 4], title: "Kamila Begam", description: "", image: "demo/images/photos/f.png" },
{ id: 7, parents: [5, 6], title: "Simra", description: "7", image: "demo/images/photos/f.png" }
Query
SELECT Id AS Id,
CASE WHEN ISNULL(FatherId,0) <> 0 OR ISNULL(MotherId,0) <> 0 THEN
CAST(FatherId AS VARCHAR(25)) + ',' + CAST(MotherId AS VARCHAR(25)) END AS parents,
EnglishName AS title,
[Description] AS Description,
[Image] AS Image FROM TreeView
FOR JSON AUTO
I tried but result is {"Id":5,"parents":"1,2","title":"AJhir Ali"}
but I am expecting this {"Id":5,"parents":[1,2],"title":"AJhir Ali"}
Thanks