After building the integration service and admin interface, the next step is to deploy the channel so your support team can start using it.

Here are the steps for deploying the channel:

This is the final part of a project to build a channel from scratch:

Disclaimer: 亚博Zendeskprovides this article for demonstration and instructional purposes only. The channel developed in the article should not be used in a production environment. Zendesk does not provide support for developing a channel.

Deploying the integration service on the web

You need to deploy your channel's integration service on the web to make it accessible to Zendesk. You can use any hosting service you like so long as it supports Python web apps. The tutorial describes how to use Glitch, a service that lets you host and run web applications in the cloud. If you don't already have a Glitch account, you can sign up for a free one.

You can skip this section if you have another hosting solution for Python web apps.

Deploying the integration service on Glitch consists of the following steps:

Creating a Glitch project

Create an empty project on Glitch.

  1. 在故障和去https://glitch.com/edit/#!/simple-blank-project.

  2. ClickRemixto create your own copy of the Glitch project.

  3. As an optional step, change the app's name and description. ClickSettings>Edit project details. After editing the name and description, clickSave.

  4. To get the URL for your project, clickShareand copy theLive sitelink. Example:

    https://zendesk-channel-tutorial.glitch.me

  5. In your integration service, replace the{glitch_url}placeholders in theintegration_manifest.jsonfile with the Glitch URL. Example:

                   
    {"name":"Community Channel","id":"my-community-channel-abc123","version":"1.0.0","urls":{"admin_ui":"https://zendesk-channel-tutorial.glitch.me/channels/community/admin_ui","pull_url":"https://zendesk-channel-tutorial.glitch.me/channels/community/pull","channelback_url":"https://zendesk-channel-tutorial.glitch.me/channels/community/channelback"}}

Preparing the integration service for deployment

When deploying, the following configuration files need to be included in the integration service's root directory:

  • requirements.txt
  • start.sh
  1. In the same folder as yourservice.pyfile, create arequirements.txtfile. Paste the following into the file:

                   
    bottle==0.12.23requests==2.28.1arrow==1.2.3python-dotenv==0.21.0

    The file lists all the external libraries the service needs to run. If needed, update the version number of each library. To find out the version, run thepip3 show {package_name}command. Example:

                   
    pip3 show bottle
  2. In the same folder, create astart.shfile. Paste the following into the file:

                   
    python3 service.py

    The file contains the shell commands that Glitch runs to start the integration service.

Uploading the integration service to Glitch

Upload the integration service to your Glitch project as a ZIP file.

Tip:If you're familiar with git and GitHub, you can import the integration service from a GitHub repo instead. SeeImporting Code from GitHubin the Glitch documentation.

  1. If running, stop the Bottle server by pressingCtrl+C.

  2. Compress the contents of the integration service project's folder, including the.envfile, into a ZIP file namedintegration_service.zip.

    Important:Don't include the folder itself in the ZIP file. You can optionally exclude any config files and folders added by your operating system, such as.DS_Storeor__MACOSX. These files aren't needed, but they won't interfere with your Glitch app.

    Example:

                   
    cd projects/channel_tutorialzip -r integration_service.zip . -x ".DS_Store" -x "__MACOSX"
  3. In your Glitch project, clickAssets.

  4. Dragintegration_service.zipintoAssets.

  5. After it uploads, click the ZIP file and copy its URL.

    你会美国e the URL later in this tutorial.

  6. At the bottom of the Glitch page, clickTerminal.

  7. In the Glitch terminal, run:

                   
    wget {zip_url}

    Replace{zip_url}with the URL you copied in step 5.

    The command returns a message similar to the following:

                   
    Saving to: 'integration_service.zip?v=123456'

    Copy the quoted file name, including the?vparameter. You'll use it in the next step.

  8. In the same Glitch terminal, run:

                   
    unzip {file_name}

    Replace{file_name}with the file name you copied in the step 7.

  9. In the Glitch terminal, run:

                   
    refresh

    The web app's files now appear under your Glitch project'sFiles.

  10. In the Glitch terminal, run:

                   
    pip3 install -r requirements.txt

    The command installs the Python packages in your app'srequirements.txtfile.

  11. As an optional step, delete the ZIP file and related asset from step 4. They're no longer needed, but they won't interfere with your Glitch app.

Creating a channel installer

You install your new channel in a Zendesk Support account with aZendesk app.

To create the channel installer

  1. In your shell, navigate to the folder where you want to save the app. Example:

                   
    cd projects
  2. In the folder, run:

                   
    zcli apps:new
  3. When prompted, enter the following information:

    • Directory name:installer
    • Author's name: Your name
    • Author's email: Your email address
    • Author's website: Leave blank and press Enter.
    • App name:Community Channel Installer

    After you're done, ZCLI creates the required files for a new app in theinstallerfolder.

    The properties of the app are recorded in a file namedmanifest.json, which should not be confused with the channel'sintegration_manifest.jsonfile. By default themanifest.jsonfile defines a sidebar app in Support. However, the only job your app has is to create a channel in a Zendesk Support instance. This kind of app is known as arequirements-only app. It doesn't display anything or do anything else. You'll change this in the next step.

  4. Open themanifest.jsonfile in theinstallerfolder (not the channel'sintegration_manifest.jsonfile in your project folder) and make the following changes:

    • Add"requirementsOnly": trueto the manifest properties
    • Add"singleInstall": trueto the manifest properties
    • Delete the"locations"property
    • Delete the"frameworkVersion"property

    The updated manifest file should look like this:

                   
    {"name":"Community Channel Installer","requirementsOnly":true,"singleInstall":true,"author":{"name":"J Doe","email":"[email protected]"},"defaultLocale":"en","private":true,"version":“1.0”}
  5. Create a file namedrequirements.jsonwith the other app files in theinstallerfolder.

  6. Add the following JSON object to therequirements.jsonfile and save it:

                   
    {"channel_integrations":{"my-community-channel-abc123":{"manifest_url":"{glitch_url}/channels/community/manifest"}}}

    Specify theidin your channelmanifest.jsonfile as the name of the integration. In this tutorial, the id is "my-community-channel-abc123".

    Replace{glitch_url}with the host name of your deployed service. Example: "https ://zendesk-channel-tutorial.glitch.me".

  7. In theinstallerfolder, run :

                   
    zcli apps:package

    ZCLI will create a ZIP file containing your app in a subfolder namedtmp.

Installing and testing the channel in Support

  1. Sign in as an admin inAdmin Center, go toApps and integrations>Apps>Zendesk Support apps, then follow the instructions to upload and install a private app. For details, seeUploading and installing your private app in Zendesk Support. Make sure your channel installer app is enabled in the account.

  2. In Admin Center, go toApps and integrations>Apps>Channel apps, and select your channel integration from the list. If you don't see your integration, make sure the channel installer app is enabled in the account.

  3. Click the Accounts tab, then click theAdd Accountbutton. Zendesk displays your admin interface:

  4. Enter an id for a community topic and clickSave. Your channel is activated.

  5. 测试通道。

    SeeUnderstanding the user experiencein part 1 of the project.

    Check your Glitch project's logs for issues.

    Create posts in the community.

    Wait a few minutes for Zendesk to make its first pull request and verify that corresponding tickets are created in Support.

    Add a comment to a ticket and verify that the comment is added to the corresponding community post.

    Verify that subsequent pull requests pull only new posts.

In this tutorial, you deployed a community channel for Zendesk Support. You can keep tweaking and making enhancements to the channel if you like. For example, you could track more than one community topic.