How to implement Zendesk Chat(Zopim) in c# Form

575 views Asked by At

I made a plugin for Revit (Autodesk) that starts an external Form using: System.Windows.Forms; in c# from the assembly PresentationCore. Know i want to fill this window with a Zendesk Chat (Zopim). Unfortunately i have no idea how to use REST APIs in c#. I just looke into the topic today.

So detailed what i want: I want that when the Form is opening that the programm loads the Zopim chat form and puts it into the my c# Form.

I already know that i somehow need to get the Form of the chat and that i need to parse it into my form.

Problems are: I can't find the zopim chat form. I don't know how to convert it into my UI.

Zendesk API
A Screenshot of my Form i created

My Code of the Form:

[Transaction(TransactionMode.Manual)]
class DoSomething : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
    {
        this.StartForm();
        return Result.Succeeded;
    }

    public void StartForm()
    {
        //EXECUTE AN EXTERNAL WINDOW
        System.Windows.Forms.Form myF = new System.Windows.Forms.Form();
        myF.FormBorderStyle = FormBorderStyle.SizableToolWindow;
        myF.StartPosition = FormStartPosition.CenterScreen;
        myF.Width = 400;
        myF.Height = 600;
        myF.HelpButton = true;
        Button cButton = new Button();
        cButton.Text = "Cancel";
        myF.CancelButton = cButton;
        myF.FormClosing += delegate (object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            myF.WindowState = FormWindowState.Minimized;
        };
        myF.Show();
    }
}
1

There are 1 answers

0
HansPI On BEST ANSWER

I found an alternative way. Zendesk Chat (Zopim) does offer a JavaScript add-in. The best way is to start a System.Windows.Forms.WebBrowser and implement the JavaScript Code from Zopim inside your HTML File that refers to the apllication by the WebBrowser.