Comments (1)
Hi guys! Posting here the response that I was given on Slack from @rmtuckerphx for those who will have the same question.
There are 2 ways to approach this:
- Write code that maps the vonage request/response to a Jovo CorePlatform-derived request response. You are responsible for converting between the two usually in the server.express.ts file
- Write your own implementation that requires you to create: Vonage.ts, VonageDevice.ts, VonagePlatform.ts, VonageRequest.ts, VonageResponse.ts and VonageUser.ts.
The best way to do option 2 is to look at the Facebook and Alexa platforms
https://github.com/jovotech/jovo-framework/tree/v4/latest/platforms/platform-facebookmessenger/src
https://github.com/jovotech/jovo-framework/tree/v4/latest/platforms/platform-alexa/src
Option 2 is the most powerful. If vonage uses HTTPS endpoint and the body of the request is the request object that you want to use, you can use the existing ExpressJs class.
Important parts using Facebook as an example:
- FacebookMessangerRequest - defines the structure of the request JSON and get/set functions map to properties on that object. Pay attention to getRequestId, getInputText
- FacebookMessangerResponse - defines structure of output JSON
- FacebookMessangerUser - id property maps to property on this.jovo.$request which is set as part of call to ExpressJs
- FacebookMessangerPlatform - ties everything together. Pay attention to isRequestRelated as that is how Jovo knows to pick a platform based on the request JSON. All it does is pick a few properties from the request that will identify this JSON as belonging to one platform instead of another. Similarly, there is a isResponseRelated.
Thanks, @rmtuckerphx!
from jovo-framework.
Related Issues (20)
- Support Jovo v3 with alexa-verifier-middleware: 2.0.1 HOT 4
- Delete Reminder not working HOT 2
- CanFulfillIntentRequest failed with version 4.3.1 HOT 2
- Unwanted Interaction between UNHANDLED, routing and order of component inclusion in app.ts HOT 7
- Quick replies are set in the wrong directive on Alexa
- Jovo 4.5.0 Error in JovoDebugger dependency makes it unusable HOT 2
- Dependency Injection not working in AWS Lambda HOT 5
- Update jovo-db-mongodb v3 from mongodb:3.7.3 to mongodb:4.12.1 HOT 1
- Error using audioplayer events with UNHANDLED function in GlobalComponent HOT 2
- Error: Missing required argument #1 HOT 1
- Don't require package-lock.json HOT 1
- Jovo Debugger stopped showing $output HOT 1
- Cannot initialize Custom Platform. The custom platform is not seen as extended class of Plugin HOT 2
- [BUG] Initializing the TestSuite Class in the test file, create a wrong sourcemap to jest. (Show the wrong error line in the error log) HOT 3
- LexSlu Plugin: Expose LexRuntimeV2ClientConfig as libraryConfig and make it optional
- Deploying to Alexa fails with headers.find is not a function HOT 4
- Cannot convert undefined or null to object while building project files for Alexa HOT 1
- SpeechRecognizer doesn't support enabled: false
- Add type checking to resolve object
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.
from jovo-framework.