Configuration

To configure a channel in your extension, you need to add an entry in your extension's resource.json, as shown in the sample code. This entry specifies the settings of the channel and the endpoints for pulling or pushing data for syncing. When you install the extension, the custom channel will be created based on this entry.

The params to be specified in resources.json are listed below.

 

FieldTypeDescription
resourceNameString
required
Defines the name of the resource.
channelLogoPathstring (URL)
required
Relative Path of the channel's logo image in the app directory.
Logo Specification:
image-format : png, jpg
max-size : 500kb
acceptAttachmentsBooleanSpecifies whether attachments can be added to the replies of this channel.
Default: false
updateRecordsBooleanSpecifies whether the replies of this channel can be updated.
Default: false
contentTypesJSONArray 

Specifies the allowed/supported content types (MIME types) for the replies of this channel.
Default: text/plain
Allowed Values :

  • text/plain
  • text/html
includeQuotedMessageBooleanSpecifies whether to add the previous replies as quoted to the replies while replying to this channel.
Default: false
includeQuotedMessageBooleanSpecifies whether to add the previous replies as quoted to the replies while replying to this channel.
Default: false
syncJSONObject 
SYNC_OBJECT
required
Sync property of the channel defines the endpoints that are used for handling data sync.
redirectUrlstring (URL)URL that redirect the user to the external resource of an entity. Refer Source Redirection.
 

Sync Object

FieldTypeDescription
pushstring(URL)
required
An endpoint that accepts the replies from the desk by an agent to process and update them in the external service.
Refer Push Request from Desk
pullstring (URL)An endpoint that provides updated data from external service / channel when the desk periodically requests it. The pullUrl will be triggered every 4 minutes.
Refer Pull Request from Desk

 

 

Source Redirection (redirectUrl)

The redirectUrl endpoint specified in the resource.json helps you to redirect to the external resource of an entity when requested from the desk.

Source Redirection Query Params

 

FieldDescription
entity

Type of the entity to be redirected.Supported Values are

  • ticket
  • thread
  • user_profile
idExternal Id of the entity in the external service.
parentIdExternal Parent Id of the entity. In case of threads, parentId contains the extId of the ticket.

For Example:

Let's consider  an agent views a ticket, a hyperlink to the external resource will be shown to the agent. On clicking the hyperlink, the agent is redirected to the redirectUrl in the resource.json with the extId of the resource and the type of the entity as queryParams of the Url. The redirect URL should parse these queryParams and redirect the agent to the external service which contains the resource.

Sample format for redirectUrl: https://zohodeskapp.example.com/youtube/handleRedirect?entity=thread&id=1688530587950_6958455459588&parentId=6958455459588_1233343hdshbdd23

Copied"channel": {
    "resourceName"        :"youtube_app",
    "channelLogoPath"     : "/app/img/youtube_logo.png",
    "acceptAttachments"   : false,
    "updateRecords"       : true,
    "contentTypes"        : ["text/plain","text/html"],
    "includeQuotedMessage": false,
    "sync": {
        "push": "https://zohodeskapp.example.com/youtube/handlePull",
        "pull": "https://zohodeskapp.example.com/youtube/handlePush"
    },
  "redirectUrl"     : "https://zohodeskapp.example.com/youtube/handleRedirect"
}