Skip to main content

Notifications

Copilot Studio - Bot Extensibility
Answered

Embedding copilot studio bot into custom angular web app with Direct Line Token

(1) ShareShare
ReportReport
Posted on by 4

Hello,

 

I have a web application written in the latest version of Angular that I am trying to embed a microsoft chat bot into. For security purposes I was hoping to leverage a direct line token and hence have enabled "Require secured access" in Web channel security.

 

I am able to generate the token successfully server-side and am trying to use this token in the query string of an iframe with the url looking something like 

 

 

 

https://copilotstudio.microsoft.com/environments/{botEnvironment}/bots/{botReference}/webchat?__version__=2&t={token}

 

 

 

My chatbot window does not load. Looking at the developer tools I see a 404 for the following request URL (environment and bot references abstracted)

 

 

https://{botEnvironment}.d2.environment.api.powerplatform.com/powervirtualagents/botsbyschema/{botReference}/webchatsettings?api-version=2022-03-01-preview

 

 

 

Is anyone able to assist me in identify what I am doing wrong? I have no issues communicating with my server from within copilot studio, just when trying to host the iframe within my web app.

 

Categories:
  • JacDomney Profile Picture
    JacDomney 4 on at
    Re: Embedding copilot studio bot into custom angular web app with Direct Line Token

    Thanks @renatoromao 

  • Verified answer
    renatoromao Profile Picture
    renatoromao 6,819 on at
    Re: Embedding copilot studio bot into custom angular web app with Direct Line Token

    Hi @JacDomney ,

     

    They have changed a little bit the way to implement this bot as an iframe.

    You could change the following parameters "_____here___" by using the Copilot Studio >> Settings >>Copilot details >> Advanced on the left-hand side.

    https://web.powerva.microsoft.com/environments/______ENVIRONMENTID_____/bots/______SCHEMANAME______/webchat?__version__=2 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics