SlideShare uma empresa Scribd logo
1 de 13
BOT FRAMEWORK AND XAMARIN.FORMS APPLICATION INTEGRATION
USING
DIRECT LINE CLIENT API
+
BRYAN ANTHONY GARCIA
• Works at Avanade
• Mobile Developer
• Xamarin.Forms, UWP, HoloLens, Web, and Azure solutions
• Graphic Designer
Your Speaker
Direct Line API
CLIENT APPLICATIONS
DIRECT LINE CLIENT
API
BOT
Authorization
Direct Line API RESTful Interface
Create
Conversation
Send Message Get Reply
Refresh
Conversation
Authentication – Secret and Token
Secret
• Application-wide key to secure the direct line channel.
• Can access any conversation, and create tokens. Secrets do not expire.
Token
• Optional
• Conversation-specific key.
• Tokens expire in 30 minutes, but can be refreshed.
Response:
HTTP/1.1 200 OK
RCurR_XV9ZA.cwA.BKA.iaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg8qbOF5xPGfiCpg4Fv0y8qqbxn - TOKEN
Authentication –W Secrets and Tokens
Request:
POST directline.botframework.com/api/tokens/conversations
Authorization: [BotConnector or Bearer] <secret key here>
This operation is optional. Use this step if you want to prevent clients from accessing
conversations they aren't participating in.
directline.botframework.com routes your client to the nearest datacenter.
This is the best option if you do not know where your client is located.
asia.directline.botframework.com routes only to Direct Line servers in Eastern Asia.
europe.directline.botframework.com routes only to Direct Line servers in Europe.
northamerica.directline.botframework.com routes only to Direct Line servers in North America.
Geographic Direct Line endpoints
Use Geographic-specific endpoints to ensure your traffic ends up in exactly the right
datacenter. A great way to avoid sending your packets on an accidental trans-Atlantic or
trans-Pacific journey!
Response:
{
"conversationId": "abc123",
"token“ :
"RCurR_XV9ZA.cwA.BKA.iaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg4Fv0y8qbOF5xPGfiCpg4Fv0y8qqbOF5x8qbOF5xn",
"expires_in": 1800
}
Create Conversation
Request:
POST directline.botframework.com/api/conversations/
Authorization: [BotConnector or Bearer] <secret key or token here>
Direct Line conversations are explicitly opened by clients and may run as long as the bot
and client participate (and have valid credentials. More than one client may connect to a
given conversation. If successful, the Direct Line service replies with a JSON object
containing a conversation ID and a token.
Response:
HTTP/1.1 204 No Content
Send Message
Request:
POST directline.botframework.com/api/conversations/<conversationId>/messages
Authorization: [BotConnector or Bearer] <secret key or token here>
{ "text": "hello",
"from": "user1“ }
No data is returned in this call. If the bot generates an error, that error will trigger an HTTP
500 error in the POST /api/conversations/{conversationId}/messages call.
Response:
{
"messages": [{ "conversation": "abc123", "id": "abc123|0000", "text": "hello", "from": "user1" }, {
"conversation": "abc123", "id": "abc123|0001", "text": "Nice to see you, user1!", "from": "bot1" }],
"watermark": "000002“
}
Get Bot Replies
Request:
GET directline.botframework.com/api/conversations/<conversationId>/messages
Authorization: [BotConnector or Bearer] <secret key or token here>
Clients issue GET calls to the /api/conversations/{conversationId}/messages endpoint to
get all messages inside the conversation. Optionally supply a watermark indicating the
most recent message seen.
Response:
HTTP/1.1 200 OK
Refresh Conversation
Request:
GET directline.botframework.com/api/tokens/{conversationId}/renew
Authorization: [BotConnector or Bearer] <secret key or token here>
Conversations or tokens are valid for 30 minutes from the time they are generated.
Cannot be refreshed if it’s already expired.
Prism MVVM
https://github.com/PrismLibrary/Prism
An MVVM framework for building loosely coupled, maintainable, and testable XAML
applications in WPF, Windows 10 UWP, and Xamarin Forms.
Xamarin Plugins
https://github.com/xamarin/XamarinComponents
Collection of open source components (including bindings and plugins) created by
Xamarin and others in the community.

Mais conteúdo relacionado

Mais procurados

Introduction to OAuth 2.0 - Part 1
Introduction to OAuth 2.0 - Part 1Introduction to OAuth 2.0 - Part 1
Introduction to OAuth 2.0 - Part 1Nabeel Yoosuf
 
Sys02 best way to create a share point app
Sys02   best way to create a share point appSys02   best way to create a share point app
Sys02 best way to create a share point appDotNetCampus
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsAnirban Sen Chowdhary
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connectDerek Binkley
 
Use Xamarin.Forms and surprise your customers when develop native apps, in le...
Use Xamarin.Forms and surprise your customers when develop native apps, in le...Use Xamarin.Forms and surprise your customers when develop native apps, in le...
Use Xamarin.Forms and surprise your customers when develop native apps, in le...Paulo Cesar Ortins Brito
 
Integration of linked in using mule esb
Integration of linked in using mule esbIntegration of linked in using mule esb
Integration of linked in using mule esbSanjeet Pandey
 
Integrate facebook using mule esb
Integrate facebook using mule esbIntegrate facebook using mule esb
Integrate facebook using mule esbSanjeet Pandey
 
Text Deck Case Study
Text Deck Case StudyText Deck Case Study
Text Deck Case StudyBlueVia
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsSalesforce Developers
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoWilliam Yang
 
A simple PHP LinkedIn OAuth 2.0 example
A simple PHP LinkedIn OAuth 2.0 exampleA simple PHP LinkedIn OAuth 2.0 example
A simple PHP LinkedIn OAuth 2.0 exampleMattia Reggiani
 
Open Id, O Auth And Webservices
Open Id, O Auth And WebservicesOpen Id, O Auth And Webservices
Open Id, O Auth And WebservicesMyles Eftos
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroTaylor Singletary
 
Creating & consuming simple web service
Creating & consuming simple web serviceCreating & consuming simple web service
Creating & consuming simple web serviceAbhijit B.
 
Creating cloud ready enterprise applications with the sharepoint 2013 app model
Creating cloud ready enterprise applications with the sharepoint 2013 app modelCreating cloud ready enterprise applications with the sharepoint 2013 app model
Creating cloud ready enterprise applications with the sharepoint 2013 app modelInnoTech
 
Azure bot service
Azure bot serviceAzure bot service
Azure bot serviceIan Chen
 

Mais procurados (20)

Introduction to OAuth 2.0 - Part 1
Introduction to OAuth 2.0 - Part 1Introduction to OAuth 2.0 - Part 1
Introduction to OAuth 2.0 - Part 1
 
Sys02 best way to create a share point app
Sys02   best way to create a share point appSys02   best way to create a share point app
Sys02 best way to create a share point app
 
Setting up your ring central sandbox in steps
Setting up your ring central sandbox in stepsSetting up your ring central sandbox in steps
Setting up your ring central sandbox in steps
 
S4 line business platform
S4 line business platformS4 line business platform
S4 line business platform
 
Creating a Sign On with Open id connect
Creating a Sign On with Open id connectCreating a Sign On with Open id connect
Creating a Sign On with Open id connect
 
Use Xamarin.Forms and surprise your customers when develop native apps, in le...
Use Xamarin.Forms and surprise your customers when develop native apps, in le...Use Xamarin.Forms and surprise your customers when develop native apps, in le...
Use Xamarin.Forms and surprise your customers when develop native apps, in le...
 
Integration of linked in using mule esb
Integration of linked in using mule esbIntegration of linked in using mule esb
Integration of linked in using mule esb
 
Integrate facebook using mule esb
Integrate facebook using mule esbIntegrate facebook using mule esb
Integrate facebook using mule esb
 
Text Deck Case Study
Text Deck Case StudyText Deck Case Study
Text Deck Case Study
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected Apps
 
Mule ESB integration with Stripe
Mule ESB integration with StripeMule ESB integration with Stripe
Mule ESB integration with Stripe
 
Easy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with PicoEasy Web Serivce on iOS with Pico
Easy Web Serivce on iOS with Pico
 
A simple PHP LinkedIn OAuth 2.0 example
A simple PHP LinkedIn OAuth 2.0 exampleA simple PHP LinkedIn OAuth 2.0 example
A simple PHP LinkedIn OAuth 2.0 example
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Open Id, O Auth And Webservices
Open Id, O Auth And WebservicesOpen Id, O Auth And Webservices
Open Id, O Auth And Webservices
 
LinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To HeroLinkedIn OAuth: Zero To Hero
LinkedIn OAuth: Zero To Hero
 
Creating & consuming simple web service
Creating & consuming simple web serviceCreating & consuming simple web service
Creating & consuming simple web service
 
Chatbot Meetup
Chatbot MeetupChatbot Meetup
Chatbot Meetup
 
Creating cloud ready enterprise applications with the sharepoint 2013 app model
Creating cloud ready enterprise applications with the sharepoint 2013 app modelCreating cloud ready enterprise applications with the sharepoint 2013 app model
Creating cloud ready enterprise applications with the sharepoint 2013 app model
 
Azure bot service
Azure bot serviceAzure bot service
Azure bot service
 

Semelhante a DirectLineAPI - Xamarin.Forms App and Bot Framework Integration

From ZERO to REST in an hour
From ZERO to REST in an hour From ZERO to REST in an hour
From ZERO to REST in an hour Cisco DevNet
 
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectDemystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectVinay Manglani
 
How APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile EnvironmentsHow APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile EnvironmentsWSO2
 
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...Vladimir Bychkov
 
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...apidays
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Nino Ho
 
Implementing OAuth
Implementing OAuthImplementing OAuth
Implementing OAuthleahculver
 
How to Implement Conversational IVR
How to Implement Conversational  IVRHow to Implement Conversational  IVR
How to Implement Conversational IVRkore.ai
 
Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0Kai Hofstetter
 
What the Heck is OAuth and OIDC - UberConf 2018
What the Heck is OAuth and OIDC - UberConf 2018What the Heck is OAuth and OIDC - UberConf 2018
What the Heck is OAuth and OIDC - UberConf 2018Matt Raible
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...CA API Management
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2Aaron Parecki
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedTaswar Bhatti
 
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020Matt Raible
 

Semelhante a DirectLineAPI - Xamarin.Forms App and Bot Framework Integration (20)

Api security
Api security Api security
Api security
 
From ZERO to REST in an hour
From ZERO to REST in an hour From ZERO to REST in an hour
From ZERO to REST in an hour
 
OAuth and Open-id
OAuth and Open-idOAuth and Open-id
OAuth and Open-id
 
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID ConnectDemystifying SAML 2.0,Oauth 2.0, OpenID Connect
Demystifying SAML 2.0,Oauth 2.0, OpenID Connect
 
How APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile EnvironmentsHow APIs Can Be Secured in Mobile Environments
How APIs Can Be Secured in Mobile Environments
 
LINE Messaging API Workshop
LINE Messaging API WorkshopLINE Messaging API Workshop
LINE Messaging API Workshop
 
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
2019 - Tech Talk DC - Token-based security for web applications using OAuth2 ...
 
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
Apidays Paris 2023 - Securing Microservice-based APIs, Michal Trojanowski, Cu...
 
Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares Oauth Nightmares Abstract OAuth Nightmares
Oauth Nightmares Abstract OAuth Nightmares
 
Implementing OAuth
Implementing OAuthImplementing OAuth
Implementing OAuth
 
How to Implement Conversational IVR
How to Implement Conversational  IVRHow to Implement Conversational  IVR
How to Implement Conversational IVR
 
Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0Securing APIs with OAuth 2.0
Securing APIs with OAuth 2.0
 
Wechat Bible for Brands v1
Wechat Bible for Brands v1Wechat Bible for Brands v1
Wechat Bible for Brands v1
 
What the Heck is OAuth and OIDC - UberConf 2018
What the Heck is OAuth and OIDC - UberConf 2018What the Heck is OAuth and OIDC - UberConf 2018
What the Heck is OAuth and OIDC - UberConf 2018
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
 
An Introduction to OAuth2
An Introduction to OAuth2An Introduction to OAuth2
An Introduction to OAuth2
 
Introduction to OAuth
Introduction to OAuthIntroduction to OAuth
Introduction to OAuth
 
Devteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystifiedDevteach 2017 OAuth and Open id connect demystified
Devteach 2017 OAuth and Open id connect demystified
 
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
 

Último

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

DirectLineAPI - Xamarin.Forms App and Bot Framework Integration

  • 1. BOT FRAMEWORK AND XAMARIN.FORMS APPLICATION INTEGRATION USING DIRECT LINE CLIENT API +
  • 2. BRYAN ANTHONY GARCIA • Works at Avanade • Mobile Developer • Xamarin.Forms, UWP, HoloLens, Web, and Azure solutions • Graphic Designer Your Speaker
  • 3. Direct Line API CLIENT APPLICATIONS DIRECT LINE CLIENT API BOT
  • 4. Authorization Direct Line API RESTful Interface Create Conversation Send Message Get Reply Refresh Conversation
  • 5. Authentication – Secret and Token Secret • Application-wide key to secure the direct line channel. • Can access any conversation, and create tokens. Secrets do not expire. Token • Optional • Conversation-specific key. • Tokens expire in 30 minutes, but can be refreshed.
  • 6. Response: HTTP/1.1 200 OK RCurR_XV9ZA.cwA.BKA.iaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg8qbOF5xPGfiCpg4Fv0y8qqbxn - TOKEN Authentication –W Secrets and Tokens Request: POST directline.botframework.com/api/tokens/conversations Authorization: [BotConnector or Bearer] <secret key here> This operation is optional. Use this step if you want to prevent clients from accessing conversations they aren't participating in.
  • 7. directline.botframework.com routes your client to the nearest datacenter. This is the best option if you do not know where your client is located. asia.directline.botframework.com routes only to Direct Line servers in Eastern Asia. europe.directline.botframework.com routes only to Direct Line servers in Europe. northamerica.directline.botframework.com routes only to Direct Line servers in North America. Geographic Direct Line endpoints Use Geographic-specific endpoints to ensure your traffic ends up in exactly the right datacenter. A great way to avoid sending your packets on an accidental trans-Atlantic or trans-Pacific journey!
  • 8. Response: { "conversationId": "abc123", "token“ : "RCurR_XV9ZA.cwA.BKA.iaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg4Fv0y8qbOF5xPGfiCpg4Fv0y8qqbOF5x8qbOF5xn", "expires_in": 1800 } Create Conversation Request: POST directline.botframework.com/api/conversations/ Authorization: [BotConnector or Bearer] <secret key or token here> Direct Line conversations are explicitly opened by clients and may run as long as the bot and client participate (and have valid credentials. More than one client may connect to a given conversation. If successful, the Direct Line service replies with a JSON object containing a conversation ID and a token.
  • 9. Response: HTTP/1.1 204 No Content Send Message Request: POST directline.botframework.com/api/conversations/<conversationId>/messages Authorization: [BotConnector or Bearer] <secret key or token here> { "text": "hello", "from": "user1“ } No data is returned in this call. If the bot generates an error, that error will trigger an HTTP 500 error in the POST /api/conversations/{conversationId}/messages call.
  • 10. Response: { "messages": [{ "conversation": "abc123", "id": "abc123|0000", "text": "hello", "from": "user1" }, { "conversation": "abc123", "id": "abc123|0001", "text": "Nice to see you, user1!", "from": "bot1" }], "watermark": "000002“ } Get Bot Replies Request: GET directline.botframework.com/api/conversations/<conversationId>/messages Authorization: [BotConnector or Bearer] <secret key or token here> Clients issue GET calls to the /api/conversations/{conversationId}/messages endpoint to get all messages inside the conversation. Optionally supply a watermark indicating the most recent message seen.
  • 11. Response: HTTP/1.1 200 OK Refresh Conversation Request: GET directline.botframework.com/api/tokens/{conversationId}/renew Authorization: [BotConnector or Bearer] <secret key or token here> Conversations or tokens are valid for 30 minutes from the time they are generated. Cannot be refreshed if it’s already expired.
  • 12. Prism MVVM https://github.com/PrismLibrary/Prism An MVVM framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms.
  • 13. Xamarin Plugins https://github.com/xamarin/XamarinComponents Collection of open source components (including bindings and plugins) created by Xamarin and others in the community.