botconnectorapi's People
Forkers
akankshagadari barroyo91 ravikiran1810 trisanganguly cyberxmary dtlogic moriti-ramolefo fabreut manoharpalanisamybotconnectorapi's Issues
NullReferenceException: Object reference not set to an instance of an object
I was following the following Twillio blog to connect Power Virtual Agents (PVA) bots to Twilio using a Relay Bot in C# (link).
I cloned this project as mentioned in the blog, where I proceeded to update the parameters to the appSettings.json
file with the values collected from the PVA bot.
I then ran the C# project using the dotnet watch run
from within the project folder in my terminal. This loaded up a Swagger page on http://localhost:5157/swagger/index.html
, which I then used to test the relay bot.
After filling in the From
and Body
parameters in the request, I executed the API request, which failed.
Here is the error log from the terminal:
Please note that I have changed the
from
number to something random, but in the actual request, I did put in the correct Twilio phone number.
From: +19999999999, hi
s_tokens: eyJhbGciOiJSUzI1NiIsImtpZCI6Ii1FMmRMMlhXZ2tCSTNmLV93MTNrWUE0YXBXTSIsIng1dCI6Ii1FMmRMMlhXZ2tCSTNmLV93MTNrWUE0YXBXTSIsInR5cCI6IkpXVCJ9.eyJib3QiOiJmOWFkYzJiZC01YmZjLTRiNWUtYTA3Zi1kYzY4OTdjMDQ1YmQiLCJzaXRlIjoiSEp6eE1STjBTcGciLCJjb252IjoiNFRTRHNxWUlGZHEzT0FaRFRCOXdMei1ldSIsInVzZXIiOiIyOTNkZGNiMi0zNzA5LTRlNDItOGNlZS00NTUxNmY3YTFiNDEiLCJuYmYiOjE2ODQzNDczMDksImV4cCI6MTY4NDM1MDkwOSwiaXNzIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIiwiYXVkIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIn0.jYx9HCxOFTYNS68MwIc-XejfiKRQF08zLQMv4RCIIukaSHE-fbljFw8jHjhqgTTmEMCyCxGfOmfa36Kv1kJQ8VXkUluOtReolyONVtMjvozs_1Tyif33CVFKDfW9ef-iyMCVWmOOEi5JO9sPoREASbjjJDzTSNLwKsdTjnEUtcmFMiLuOEtB6mm1YMtuNOpej4fWL70jiB94o5UepbSx8dKdvk3qpe_K_PofVuVypwiGOgkSKTgkMpqEqUnzxLQqPI1qPJnSV635k_4I2P_x1cDMjUQ2d-g5AKhqeEtPNfqcbt4ULD76_cdslTWQHOE5Ky6z7LggOHPmJKtXsxPnKg
token: eyJhbGciOiJSUzI1NiIsImtpZCI6Ii1FMmRMMlhXZ2tCSTNmLV93MTNrWUE0YXBXTSIsIng1dCI6Ii1FMmRMMlhXZ2tCSTNmLV93MTNrWUE0YXBXTSIsInR5cCI6IkpXVCJ9.eyJib3QiOiJmOWFkYzJiZC01YmZjLTRiNWUtYTA3Zi1kYzY4OTdjMDQ1YmQiLCJzaXRlIjoiSEp6eE1STjBTcGciLCJjb252IjoiNFRTRHNxWUlGZHEzT0FaRFRCOXdMei1ldSIsInVzZXIiOiIyOTNkZGNiMi0zNzA5LTRlNDItOGNlZS00NTUxNmY3YTFiNDEiLCJuYmYiOjE2ODQzNDczMDksImV4cCI6MTY4NDM1MDkwOSwiaXNzIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIiwiYXVkIjoiaHR0cHM6Ly9kaXJlY3RsaW5lLmJvdGZyYW1ld29yay5jb20vIn0.jYx9HCxOFTYNS68MwIc-XejfiKRQF08zLQMv4RCIIukaSHE-fbljFw8jHjhqgTTmEMCyCxGfOmfa36Kv1kJQ8VXkUluOtReolyONVtMjvozs_1Tyif33CVFKDfW9ef-iyMCVWmOOEi5JO9sPoREASbjjJDzTSNLwKsdTjnEUtcmFMiLuOEtB6mm1YMtuNOpej4fWL70jiB94o5UepbSx8dKdvk3qpe_K_PofVuVypwiGOgkSKTgkMpqEqUnzxLQqPI1qPJnSV635k_4I2P_x1cDMjUQ2d-g5AKhqeEtPNfqcbt4ULD76_cdslTWQHOE5Ky6z7LggOHPmJKtXsxPnKg
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.NullReferenceException: Object reference not set to an instance of an object.
at myBotConnector.Controllers.BotConnectorController.StartConversation(String inputMsg, String token) in C:\Users\rawatsid\Documents\BotConnectorAPI\Controllers\myBotConnectorController.cs:line 67
at myBotConnector.Controllers.BotConnectorController.StartBot(String From, String Body) in C:\Users\rawatsid\Documents\BotConnectorAPI\Controllers\myBotConnectorController.cs:line 55
at lambda_method5(Closure, Object)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
If I'm not wrong, the above error points to the myBotConnectorController.cs
file, at line 67:
private async Task<string> StartConversation(string inputMsg, string token)
{
Console.WriteLine("token: " + token);
using (var directLineClient = new DirectLineClient(token))
{
var conversation = await directLineClient.Conversations.StartConversationAsync();
var conversationtId = conversation.ConversationId;//FAIL HERE
I'm unable to debug what could be the possible problem here. Any idea as to what might be causing this problem?
European Environment Connection
Hi, I need help... Is there a way to run this bot connector api app on a european environment?
I read on MS that the default uri used is https://directline.botframework.com/ and the eu version is https://europe.directline.botframework.com/. Here's the link i read from https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-api-reference?view=azure-bot-service-4.0
not able to test it getting NullReferenceException
i dont think there is any error in the code but somehow not sure if we are giving the correct details in appsettings.json.
Please guide what details need to be provided in the appsettings.json
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.