Just recently on October 10th, Google announced a change in name of API.AI into DialogFlow. There are a couple of new features following this change. Regardless of what has been changed, in this post we are going to share a simple way of how to integrate your agents that is created using DialogFlow into any Qiscus chat SDK application.
Tips and tricks for building api heavy ruby on rails applications
The document provides tips for building API-heavy Ruby on Rails applications. It discusses using APIs from Instagram, CafePress, Spreadsheets, Google Docs, and others. It covers authentication challenges, using background jobs, effective testing strategies like mocking HTTP requests, and different approaches to OAuth authentication used by APIs like Instagram, Freshbooks, Xero, and Evernote. Code examples are provided for common API patterns like making requests, parsing responses, and implementing OAuth flows.
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
This document summarizes a presentation on smart SharePoint development. It discusses REST/OData APIs, the Client-Side Object Model, and SOAP web services. For REST/OData, it covers architecture, operations, and advantages of using URIs and HTTP methods. For CSOM, it outlines the architecture, object models, and advantages of familiar .NET development. For SOAP, it describes the standard and lists SharePoint web services supported across versions. Code examples demonstrate creating a site using REST and adding permissions using JavaScript CSOM.
Jeff Scudder, Eric Bidelman
The number of APIs made available for Google products has exploded from a handful to a slew! Get
the big picture on what is possible with the APIs for everything from YouTube, to Spreadsheets, to
Search, to Translate. We'll go over a few tools to help you get started and the things these APIs share
in common. After this session picking up new Google APIs will be a snap.
Apache Aries is an open source project for building enterprise OSGi applications. It provides several integration components like Blueprint container, JPA integration, and JNDI integration. The Aries project was created in 2009 and is currently used by projects like Apache Geronimo, Apache Felix, and JBoss OSGi. It aims to develop more application-centric features in the future like message-driven blueprint components and declarative security.
RESTful API Design & Implementation with CodeIgniter PHP FrameworkBo-Yi Wu
This document provides an overview and summary of Bo-Yi Wu's presentation on implementing a RESTful API with CodeIgniter. The presentation covers RESTful API basics like HTTP methods, JSON response format, API design best practices, and using the CodeIgniter REST Server and REST Client libraries to implement and test APIs within the CodeIgniter framework. Examples are provided for creating, updating, deleting and reading data via API requests and responses. Folder structure and routing configurations for organizing API controllers are also discussed.
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morewesley chun
This is a ~90-minute technical introduction to G Suite/Google Apps developer tools, platforms, and APIs. Code samples are in Python+JS. Motivation: encourage developers to write apps integrating with G Suite APIs so they can monetize, taking advantage of the many schools & enterprises that are G Suite users. Delivered sessions at ISTE (Jun 2019), Google Cloud NEXT (Jul 2018), Google Cloud Summit - São Paulo (Nov 2017), DevFest DC (May 2017), DevFest NYC (Nov 2016), and GDG LA DevFest (Dec 2016).
Parse: A Mobile Backend as a Service (MBaaS)Ville Seppänen
Parse is a mobile backend as a service (MBaaS), a subcategory of PaaS. This is a presentation evaluating the service for a post-graduate seminar course.
Tips and tricks for building api heavy ruby on rails applicationsTim Cull
The document provides tips for building API-heavy Ruby on Rails applications. It discusses using APIs from Instagram, CafePress, Spreadsheets, Google Docs, and others. It covers authentication challenges, using background jobs, effective testing strategies like mocking HTTP requests, and different approaches to OAuth authentication used by APIs like Instagram, Freshbooks, Xero, and Evernote. Code examples are provided for common API patterns like making requests, parsing responses, and implementing OAuth flows.
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기lanslote
This document summarizes a presentation on smart SharePoint development. It discusses REST/OData APIs, the Client-Side Object Model, and SOAP web services. For REST/OData, it covers architecture, operations, and advantages of using URIs and HTTP methods. For CSOM, it outlines the architecture, object models, and advantages of familiar .NET development. For SOAP, it describes the standard and lists SharePoint web services supported across versions. Code examples demonstrate creating a site using REST and adding permissions using JavaScript CSOM.
Jeff Scudder, Eric Bidelman
The number of APIs made available for Google products has exploded from a handful to a slew! Get
the big picture on what is possible with the APIs for everything from YouTube, to Spreadsheets, to
Search, to Translate. We'll go over a few tools to help you get started and the things these APIs share
in common. After this session picking up new Google APIs will be a snap.
Apache Aries is an open source project for building enterprise OSGi applications. It provides several integration components like Blueprint container, JPA integration, and JNDI integration. The Aries project was created in 2009 and is currently used by projects like Apache Geronimo, Apache Felix, and JBoss OSGi. It aims to develop more application-centric features in the future like message-driven blueprint components and declarative security.
This document provides an overview of the Parse platform and its capabilities for building mobile and web applications. It describes Parse Core which allows storing and querying data in the cloud. It also covers user authentication, social integration, push notifications, cloud code, and analytics tracking. The document shows how to perform common tasks like saving and querying objects, user signup/login, and sending push notifications. It emphasizes that Parse provides a full backend as a service to focus on app business logic and UI rather than operations.
DF12 - Process Orchestration using Streaming API and Herokuafawcett
The Streaming API can provide near real time updates on changes to any object data in an organisation. In this session we will demonstrate and share code for a custom Process Orchestration solution powered by the Streaming API and Heroku. Using this solution users can define criteria which the platform will apply to monitor records created or updated by users in real time. The session will demonstrate an example process using REST services taken from those offered by many of todays leading REST API providers including Salesforce.
The document discusses configuring continuous delivery of Android apps to the Google Play Store using the Google Play Developer API. It covers setting up a service account in the Google Developer Console, installing the API library and credentials, and making API calls to create app edits, upload APK files, manage tracks and releases, and publish app listings and metadata. The goal is to enable deploying new app versions to production with a single command after code is pushed to a repository.
The document discusses various options for accessing and updating data in SharePoint lists, including CAML queries, REST APIs, and LINQ to SharePoint. CAML queries allow retrieving and filtering list items using XML syntax. REST APIs expose SharePoint data via OData feeds that can be consumed by remote applications. LINQ to SharePoint allows strongly-typed querying of lists using LINQ and generates CAML under the hood.
The document provides an overview of integrating apps with Google Drive. It discusses using the Drive SDK to access and manage files through the API, integrating the Drive web and Android UIs, and using the Google Picker API to select files. It also covers OAuth authentication flows and important security considerations around file access permissions when building Drive apps.
HTML5 will be the new standard for HTML and includes several new features such as new semantic elements, canvas element for 2D drawing, video and audio elements, local storage support and new form controls. It is still a work in progress but major browsers already support many of its new APIs and elements. Some of the key rules for HTML5 include that new features should be based on HTML, CSS, DOM and JavaScript and reduce the need for plugins.
SharePoint 2013 REST API & Remote AuthenticationAdil Ansari
This document provides an overview and samples of using the SharePoint 2013 REST API and remote authentication. It describes how to use HTTP commands with the SharePoint REST service to perform CRUD operations. It provides examples of REST URLs and discusses search, authentication, batch jobs, and debugging with the REST API.
The document discusses Apple's search APIs and how they enable apps to provide rich content to Spotlight, Siri and Safari search results. It covers three APIs - NSUserActivity, App Search and CoreSpotlight - that allow indexing app content and activities to make them discoverable in searches. The document also discusses how to index web content to drive traffic to mobile apps and optimize search results through techniques like keywords, structured data and fast deep linking to improve an app's relevance ranking.
This document introduces the Database.com SDK for building Java applications that interact with Salesforce data. It discusses the key components of the SDK including the JPA provider, API connector, and OAuth authentication. It also provides an overview of how to deploy Java applications to Heroku, including using Git for deployment, configuring dynos, and other Heroku features.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Eric Shupps
The new SharePoint 2013 App model extends native SharePoint applications into the cloud, allowing developers to write applications that interact with SharePoint data remotely. With these new capabilities come additional challenges for managing security and user authorization via OAuth. Administrators, IT professionals, and developers should attend this session to familiarize themselves with the core concepts behind OAuth in SharePoint 2013, learn how best to configure and manage OAuth in their environment, and discover how OAuth is used in the SharePoint app model.
AI: Mobile Apps That Understands Your Intention When You TypedMarvin Heng
With Microsoft's Cognitive Services - Language Understanding Intelligent Service (LUIS), we can build a smart app. By following this tutorial, you should learn how to create a intelligent cross platform Mobile App that understands what is your intention.
Read more @ www.techconnect.io
By Marvin Heng
Twitter: @hmheng
Blog: www.techconnect.io
Exploring MORE Google (Cloud) APIs with Pythonwesley chun
This is a 1-hr tech talk designed for Python developers. The session continues on a previous one providing an overview of using Google APIs, primarily those from Google Cloud (G Suite and Google Cloud Platform). It introduces new APIs or new features in APIs covered previously.
Here’s a step-by-step guide to implement Flask JWT Authentication with an example. Clone the flask-jwt authentication github repo and play around with the code
The document discusses building web applications using Google Cloud technologies including Cloud Endpoints, App Engine, and Material Design principles. It provides an overview of setting up a sample application with Cloud Endpoints to define REST APIs and generate client libraries. It also covers using Polymer and Material Design elements for the frontend and connecting it to the Cloud Endpoints backend.
JavaScript & Cloud: the AWS JS SDK and how to work with cloud resourcesCorley S.r.l.
This document discusses how to build an AngularJS application that utilizes Amazon Web Services (AWS) for authentication, storage, and database functionality. It recommends using AWS Identity and Access Management (IAM) to manage user access, AWS Simple Storage Service (S3) for file storage, AWS DynamoDB for the database, and AWS Security Token Service (STS) to generate temporary credentials for unauthenticated users. Code examples are provided for setting up Angular services to interface with each AWS service, handling user login/logout via the STS, and using the services in application controllers.
Contract-driven development with OpenAPI 3 and Vert.x | DevNation Tech TalkRed Hat Developers
Have you ever been frustrated by developing and documenting an HTTP API? When it comes down to defining the HTTP interface between frontend and backend, have you ever had problems specifying the parameters or the shape of the body without misunderstandings? In this talk we’ll introduce you to "Contract Driven Development" (or API Design First approach), a methodology that uses declarative API Contracts to enable developers to efficiently design, communicate, and evolve their HTTP APIs, while automating API implementation phases where possible. In order to implement this methodology, we’ll show you how to develop an API contract using OpenAPI 3 and how you can easily implement the HTTP endpoints using Vert.x Web OpenAPI.
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
PhoneGap allows building of native mobile apps using web technologies that can be deployed across multiple devices. It uses a project structure with a www folder containing code and plugins to enable device functionality. The document demonstrates communicating with SharePoint via ASMX, REST and 2013 API, performing CRUD operations on lists using the API endpoints. It shows reading, creating, updating and deleting data through code examples.
This document provides information on building skills for Alexa using APIs and ColdBox frameworks. It discusses setting up Amazon developer accounts and AWS services accounts. It also covers creating Lambda functions in Node.js to call APIs from Alexa skills and building ColdBox REST APIs to interface with Alexa skills. The document includes code snippets for sample Lambda functions and ColdBox handlers to integrate with Alexa skills.
[2019 south bay meetup] Building more contextual message with Block KitTomomi Imura
South Bay Meetup talk about Block Kit, a UI framework that enables you to build rich and interactive experiences in Slack, also how to build a slash command using Block Kit & its demo.
Itb 2021 - Bulding Quick APIs by Gavin PickinGavin Pickin
In this session we will use ColdBox’s built in REST BaseHandler, and with CBSecurity and Quick ORM we will setup a secure API using fluent query language - and you’ll see how Quick Quick development can be!
1) The document provides details on various aspects of Flask application development including typical project structure, blueprints, databases, forms and validation, management commands, assets management, testing, and debugging.
2) It discusses Flask extensions for these areas such as Flask-SQLAlchemy, Flask-Werkzeug, Flask-Assets, Flask-Mail, and Flask-DebugToolbar.
3) The document raises some issues around porting Flask to Python 3 and the size and scope of the Werkzeug library that Flask is built upon.
How to build twitter bot using golang from scratchKaty Slemon
This document provides a tutorial on how to build a Twitter bot using Golang from scratch. It covers setting up a Twitter developer account, installing prerequisites like Golang and ngrok, configuring the .env file, implementing CRC validation, registering and subscribing webhooks, listening for events, sending tweets in response, and setting up the server. The full source code for the Twitter bot project is provided in a GitHub repository for reference. The tutorial aims to help readers develop their own Twitter bot application from start to finish without using any third-party libraries.
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
We provide some examples on how to integrate social media on Android apps, from the simple “Share” button to more complex integrations like using Twitter, LinkedIn or Facebook APIs, including logging-in with social media.
As an example we developed a open source “Social Media Demo” application with all the examples in this presentation.
The document discusses using Parse Cloud Code to build web applications, including basic operations like create, read, update, delete, how Parse and RESTful APIs work, and how to use Cloud Code to call external APIs, run background jobs, and include other JavaScript modules.
This document discusses ql.io, an open source web querying system for Node.js. It provides an overview of ql.io and its features, including defining data sources, creating tables, querying data, patching requests and responses, and integrating ql.io into Node.js applications. Various tools for working with ql.io are also presented, such as the API Masher for visualizing APIs and external tables on GitHub.
The document provides an overview of new features and enhancements in ADF 3.0, including a new JS-API that has been rewritten in Typescript, performance improvements, full SSO support, new process and task cloud components, extensibility features, and search enhancements like facet fields and a chip list component. Code examples are provided for common tasks like importing modules, listing apps and processes, and configuring SSO. Resources like documentation, repositories, and a Gitter channel are also listed for additional support.
How to build integrated, professional enterprise-grade cross-platform mobile ...Appear
Build a simple enterprise mobility application with data sync using AngularJS, Backbone or Sencha Touch using our simple step by step tutorials.
Our tutorials demonstrate how to develop a basic “train times” viewing application using the AppearIQ API. This includes generation of a boilerplate HTML5 hybrid cross-platform app (capable of running on either iOS or Android devices), introduction to data formats, application logic, how to synchronize data, testing in browsers and on devices.
The tutorials assume that you already have basic knowledge of HTML and JavaScript. If you feel that you need to go through the basics, check out some excellent external tutorials like W3Schools HTML tutorials or W3Schools Javascript tutorials.
Use of the AppearIQ cloud developer platform is free of charge. To access the tutorials click here (links to AppearIQ.com developer site)
This document describes a framework for building and launching micro-apps using Node.js, Electron, and Cordova. It discusses using Node.js to build single-page apps and a server, and leveraging Electron and Cordova to package the apps for desktop and mobile respectively. Code samples show how to configure, authenticate, and launch multiple micro-apps from a single interface on different platforms.
This document describes a framework for building and launching micro-apps using Node.js, Electron, and Cordova. It discusses using Node.js to build single-page apps and a server, and leveraging Electron and Cordova to deploy the apps as desktop and mobile applications respectively. Code samples are provided for configuring, building, and launching multiple micro-apps from a single application window on different platforms.
Similar to Integrating dialog flow (api.ai) into qiscus sdk chat application (20)
YOUR RELIABLE WEB DESIGN & DEVELOPMENT TEAM — FOR LASTING SUCCESS
WPRiders is a web development company specialized in WordPress and WooCommerce websites and plugins for customers around the world. The company is headquartered in Bucharest, Romania, but our team members are located all over the world. Our customers are primarily from the US and Western Europe, but we have clients from Australia, Canada and other areas as well.
Some facts about WPRiders and why we are one of the best firms around:
More than 700 five-star reviews! You can check them here.
1500 WordPress projects delivered.
We respond 80% faster than other firms! Data provided by Freshdesk.
We’ve been in business since 2015.
We are located in 7 countries and have 22 team members.
With so many projects delivered, our team knows what works and what doesn’t when it comes to WordPress and WooCommerce.
Our team members are:
- highly experienced developers (employees & contractors with 5 -10+ years of experience),
- great designers with an eye for UX/UI with 10+ years of experience
- project managers with development background who speak both tech and non-tech
- QA specialists
- Conversion Rate Optimisation - CRO experts
They are all working together to provide you with the best possible service. We are passionate about WordPress, and we love creating custom solutions that help our clients achieve their goals.
At WPRiders, we are committed to building long-term relationships with our clients. We believe in accountability, in doing the right thing, as well as in transparency and open communication. You can read more about WPRiders on the About us page.
UiPath Community Day Kraków: Devs4Devs ConferenceUiPathCommunity
We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner!
We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too!
Check out our proposed agenda below ��👇
08:30 ☕ Welcome coffee (30')
09:00 Opening note/ Intro to UiPath Community (10')
Cristina Vidu, Global Manager, Marketing Community @UiPath
Dawid Kot, Digital Transformation Lead @Proservartner
09:10 Cloud migration - Proservartner & DOVISTA case study (30')
Marcin Drozdowski, Automation CoE Manager @DOVISTA
Pawel Kamiński, RPA developer @DOVISTA
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
09:40 From bottlenecks to breakthroughs: Citizen Development in action (25')
Pawel Poplawski, Director, Improvement and Automation @McCormick & Company
Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company
10:05 Next-level bots: API integration in UiPath Studio (30')
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
10:35 ☕ Coffee Break (15')
10:50 Document Understanding with my RPA Companion (45')
Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath
11:35 Power up your Robots: GenAI and GPT in REFramework (45')
Krzysztof Karaszewski, Global RPA Product Manager
12:20 🍕 Lunch Break (1hr)
13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30')
Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance
13:50 Communications Mining - focus on AI capabilities (30')
Thomasz Wierzbicki, Business Analyst @Office Samurai
14:20 Polish MVP panel: Insights on MVP award achievements and career profiling
Details of description part II: Describing images in practice - Tech Forum 2024BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Bert Blevins
Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc
Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk.
What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year?
Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year.
This webinar will review:
- Key changes to privacy regulations in 2024
- Key themes in privacy and data governance in 2024
- How to maximize your privacy program in the second half of 2024
The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...Toru Tamaki
Jindong Gu, Zhen Han, Shuo Chen, Ahmad Beirami, Bailan He, Gengyuan Zhang, Ruotong Liao, Yao Qin, Volker Tresp, Philip Torr "A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models" arXiv2023
https://arxiv.org/abs/2307.12980
Comparison Table of DiskWarrior Alternatives.pdfAndrey Yasko
To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.
Choose our Linux Web Hosting for a seamless and successful online presencerajancomputerfbd
Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently.
Visit- https://onliveserver.com/linux-web-hosting/
Best Programming Language for Civil EngineersAwais Yaseen
The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era.
Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxSynapseIndia
Your comprehensive guide to RPA in healthcare for 2024. Explore the benefits, use cases, and emerging trends of robotic process automation. Understand the challenges and prepare for the future of healthcare automation
Integrating dialog flow (api.ai) into qiscus sdk chat application
1. Integrating DialogFlow (API.ai) into
Qiscus SDK Chat Application
Just recently on October 10th, Google announced a change in name of API.AI into DialogFlow. There
are a couple of new features following this change. Regardless of what has been changed, in this
post we are going to share a simple way of how to integrate your agents that is created using
DialogFlow into any Qiscus SDK chat application.
As DialogFlow doesn't have a famous 'one-click integration' feature for Qiscus (yet), we need to
make a workaround to do so. Fortunately, DialogFlow provides some integration ways through its
SDK options, here in the image, you can see several programming languages that you can use for
your agent integration.
2. Image of DialogFlow SDK for integration
For our simplicity purpose, we are going to use our last article on how to create a simple chat
application using QiscusSDK and how to integrate a simple echo bot into it as prior requirement to
this post. You can find the codes here. Since it uses Python as the webhook, in this article we are
going to use DialogFlow SDK for Python as well called apiai (this might changes later as the effect
of name change).
Another thing to note is that we assume you already have an agent or two created in DialogFlow, if
not please refer to the basic tuts to create one.
1. Add DialogFlow SDK Python Package
Alright, let's get started! First thing first, let's add DialogFlow SDK python package (apiai) into our
project, come on open setup.py file, and add it,
from setuptools import setup, find_packages
setup(
name='simplebot',
version='1.0',
long_description=__doc__,
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'apiai',
3. 'flask',
'requests'
],
)
and let's import that package into our simplebot/views.py file then instantiate new object
from this package,
import apiai
import json
import requests
from flask import render_template, request
from simplebot import app
app_id = "YOUR_APP_ID"
secret_key = "YOUR_SECRET_KEY"
sender_email = "YOUR_BOT_EMAIL"
bot_name = "YOUR_BOT_NAME"
qiscus_sdk_url = "https://{}.qiscus.com".format(app_id)
client_access_token = "YOUR_DIALOGFLOW_CLIENT_ACCESS_TOKEN"
ai = apiai.ApiAI(client_access_token)
...
.
Notice in the code above, we need client_access_token to initiate new object from the
package. So please make sure you already got this token from your agent DialogFlow console
dashboard and assign it to the client_access_token, you may want to see this image to locate
where it is.
4. image of console
2. Incoming Message and Agent Response
After you got this package set, let's implement it in our index() function. First we will need to get
query from Qiscus chat app to be passed to the DialogFlow agent before we send it to get the
response from agent.
...
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
payload = request.get_json().get('payload')
room_id = payload.get("room").get("id")
message = payload.get("message").get("text")
# let's prepare the incoming message (query) we want
to send to dialogflow agent
conv = ai.text_request()
conv.session_id =
"ADD_YOUR_UNIQUE_SESSION_ID(ANY_SESSION_ID_WOULD_WORK)"
conv.query = message
# and let's get the response from dialogflow agent
response = conv.getresponse()
response_json =
json.loads(response.read().decode('utf-8'))
5. response_messages =
response_json.get("result").get("fulfillment").get("messages")
post_url =
"{}/api/v2/rest/post_comment".format(qiscus_sdk_url)
headers = {"QISCUS_SDK_SECRET": secret_key}
data = {
"sender_email": sender_email,
"room_id": room_id,
"message": message,
"type": "text",
"payload": {}
}
req = requests.post(post_url, headers=headers,
params=data)
...
What we need to do next is just to send back any response we got from agent to the Qiscus chat
app. This can be anything: plain text or any additional payload. So, before we return it back, we need
to know the structure of payload that is returned by our agent at DialogFlow, please have a look at
JSON code below, this JSON code is the payload that is returned from our agent in DialogFlow.
{
"id": "354eaf3c-c40e-42e4-acf6-fc2ef0e71799",
"timestamp": "2017-10-26T08:11:58.239Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "yo",
"action": "hi",
"actionIncomplete": false,
"parameters": {},
"contexts": [],
"metadata": {
"intentId": "fe8dbb22-43bf-4cb4-b634-48c3a2af98ae",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "hi"
},
"fulfillment": {
"speech": "Hi! How are you doing?",
"messages": [
{
6. "type": 0,
"id": "948f5dad-550c-4fa1-93ba-3819d8e42fbb",
"speech": "Hi! How are you doing?"
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "d70073ae-0cdb-4bc4-b7d9-d8d0b16b98af"
}
From JSON code above, there is a fulfillment field. It has additional children fields that are
actual responses from our agent which we are interested in.
Also read: "Making your Apps “Chatable”"
Notice the messages field? its value is a list. So we may assume our agent could return one or
more messages when we make a request to DialogFlow. This could be another text or additional
custom payload, such as payload for button or card. However, to simplify this process, let's handle
text message only.
Ok, let's modify our index() function in views.py file again.
...
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
payload = request.get_json().get('payload')
room_id = payload.get("room").get("id")
message = payload.get("message").get("text")
# let's prepare the incoming message (query) we want
to send to dialogflow agent
conv = ai.text_request()
conv.session_id =
"ADD_YOUR_UNIQUE_SESSION_ID(ANY_SESSION_ID_WOULD_WORK)"
conv.query = message
# and let's get the response from dialogflow agent
response = conv.getresponse()
response_json =
8. 3. Webhook
Since we've been developing this integration locally, Qiscus SDK won't recognise our webhook even
though we are trying to add our local webhook address to the Qiscus SDK. So to help making our
webhook open to the internet, we are going to use ngrok and add the generated temporary
subdomain addresses into our Qiscus SDK, please refer to this for ngrok.
After you do that, please try to have a chat again through generated subdomain address in your
browser. Voila, you got a reply from your agent in DialogFlow!
Accompanying codes can be found at https://github.com/qiscus/qiscus-dialogflow. You can also
experience directly at https://qiscusdialog.herokuapp.com/.
Closing
To sum up, this article is only focusing on how we integrate our agent that is created in DialogFlow
which returns plain text only. In order to leverage your agent capability, you may want to add
additional custom payload as additional fulfillment response. For example you may want to return
message that contains image and buttons from DialogFlow. You can refer to Qiscus docs for any type
of comments that is supported by Qiscus as well as how to add custom payload in DialogFlow for
more information.