Sync - Data Transfer

Sync - Data Transfer

Desk offers the below methods to perform two-way data syncing between Desk & External Service.
  1. Pull-Request from Desk
  2. Push Reply from Desk
  3. Push-Data to Desk

Overriding read-only fields

An important usage of the syncing via channel integration is, some of the read-only system-computed fields such as createdTime, modifiedTime and direction of the thread can be specified and overridden with the original value in the external service.

#SYNC_RESPONSE_OBJECT

Desk accepts data to be synced in the below format during pull-request from desk and push-data to desk operation.


Sample #SYNC_RESPONSE_OBJECT
  1. {
  2.     "channelState":"{\"my_pending_data\":\"298092,289782,2767\"}",
  3.     "data":{
  4.         "tickets": [
  5.             #SYNC_TICKET_OBJECT,
  6.             #SYNC_TICKET_OBJECT,
  7.             #SYNC_TICKET_OBJECT,
  8.             ... max 1000
  9.         ],
  10.         "threads": [
  11.             #SYNC_THREAD_OBJECT,
  12.             #SYNC_THREAD_OBJECT,
  13.             #SYNC_THREAD_OBJECT,
  14.             ... max 1000
  15.         ]
  16.     }
  17. }

#SYNC_DATA_OBJECT
Data format to be specified in the sync response's data property.


Create or Update Tickets in Desk

Channel integration lets you create and update tickets for external resources. To import tickets to the desk, the details of the ticket has to be given in the #SYNC_TICKET_OBJECT format to the pull-request from desk & push-data to desk response's data.tickets property.

#SYNC_TICKET_OBJECT


Example of #SYNC_TICKET_OBJECT
  1. {
  2.   "data":{
  3.     "tickets":[
  4.       {
  5.         "extId":"whatsapp:+919994411345",
  6.         "subject":"How to reset the configuration?",
  7.         "createdTime":"2018-09-10T13:34:26.000Z",
  8.         "actor": #SYNC_ACTOR_OBJECT,
  9.         "extra": #SYNC_EXTRA_OBJECT
  10.       },
  11.       ...
  12.     ],
  13.     "threads":[]
    }
}

External ID

ID of the resource on external service. External ID is the value which acts as a unique identifier of the resource on the external resource. The extId property plays a significant role in identifying the corresponding desk entity of the external resource during sync. If there is no entity found for the given extId of the channel in the desk, a new entity is created otherwise the existing entity which has the extId of the channel is updated. Allowed characters : A-Z a-z 0-9 @ $ & + : . { } ( ) # - _ +
For Example
If we consider a Facebook post, every Facebook post has a unique ID (extId). When an external resource of Facebook service with extId "298393" is submitted to create a ticket in desk, if any existing ticket with Facebook channel and the same extId found then the ticket is updated with given data, otherwise a new ticket is created with facebook channel and given extId.

Adding External Attachments

If any external attachments need to be added to the tickets/threads, it has to be given as a JSON array of URLs which will be downloaded and attached to the tickets. The downloading of the attachments and adding to the tickets are asynchronous so that failure of attachments does not interrupt the process of adding/updating the tickets or threads. 
For Example
A facebook comment may contain images that you want to add as a thread.

Create or Update Threads in Desk

Channel integration lets you to add threads or replies from the external service. To import threads, provide the threads details in the #SYNC_THREAD_OBJECT format to the pull-request from desk & push-data to desk response's data.tickets property.

#SYNC_THREAD_OBJECT


Example of #SYNC_THREAD_OBJECT
  1. {
  2.   "data":{
  3.     "threads":[
  4.         {
  5.             "extId":"SMa8974b1b935d957ffd9",
  6.             "extParentId":"+123456789",
  7.             "createdTime":"2018-09-10T11:54:03.000Z",
  8.             "content":"What surprised",
  9.             "direction":"in",
  10.             "from":"+00032882",
  11.             "to":["+00000273637"],
  12.             "canReply":true,
  13.             "extra": #SYNC_EXTRA_OBJECT,
  14.             "actor": #SYNC_ACTOR_OBJECT
  15.       },
  16.       ...
  17.     ],
  18.     "tickets":[
  19.       {
  20.         "extId":"+123456789",
  21.         "subject":"Knew he didnt know, i never knew a lot too!",
  22.         "createdTime":"2018-09-07T14:02:27.000Z",
  23.         "extra": #SYNC_EXTRA_OBJECT,
  24.         "actor": #SYNC_ACTOR_OBJECT
  25.       },
  26.       ...
  27.     ]
  28.   }
  29. }

External Parent ID

This constraint is used for grouping multiple threads under a single ticket. extParentId contains the parent ID of the external resource in external service. For a thread external resource, extParentId is useful for identifying the correct ticket that the reply has to be added in the desk. Whenever an extParentId for a thread resource is given, a thread is added for the ticket that has the given extParentId as extId. If none of the ticket's extId matches the given extParentId then the thread will not be added.
For Example
If we consider a facebook-post-comment, extParentId will be the ID of the facebook post. So that comments having the same externalaParentId will be grouped under the same ticket which has the extId.

#ACTOR_OBJECT
Actor object defines the properties of the author of the resource (i.e by whom this resource was made) on the external service.


SYNC ACTOR OBJECT Sample:
  1. {
  2.     "name"        :"John Snow",
  3.     "displayName" :"John Snow @johnstark",
  4.     "email"       :"john@gmail.com",
  5.     "phone"       :"+918637436803",
  6.     "extId"  :"39jdiwkndw3ninj",
  7.     "photoURL"    :"https://example.com/profile/39jninj/photo.jpg"
  8. }

Providing app specific custom data for resources

Apps may need to store some extra details about a particular resource in addition to the desk supported standard fields of an entity.
Place holders can be given for any of the Extra-Object's properties which will be replaced with the original values of the respective entities. For supported placeholders refer Desk Resource Template Placeholders
Example
An app developer may need to store likes and share counts of a facebook post which needs to be added as a ticket or thread in the desk so that the app may show that information in the desk widgets or may need to show some actions prior to that information.

#SYNC_EXTRA_OBJECT


Sample SYNC EXTRA OBJECT:
  1. {

  2.     "key"            :"Post-{{ticket.id}}-Comment-{{thread.id}}-Details",
  3.     "queriableValue" :"Post-{{ticket.id}}-Details"
  4.     "value"          :{
  5.                         "likes":3809,
  6.                         "comments":453
  7.                       }
  8. }

Desk Resource Template Placeholders

Developer may not know the values of the resource but might want to make use of it to store some information in extension's DB storage. So developers can make use of place holders which are replaced with original values after updating the resource.

Format for the templated string with placeholder - {{PLACEHOLDER}}

Supported Placeholders are,
  1. ticket.id
  2. thread.id

extra.key

Value for the key property is a string which can be a template key. Key for which the given value has to be stored in the DB storage.
For Example,
When a like count of a post has to be stored in the extension's db storage so that an app can re-access them, the external resource response's extra.key can be specified as 
facebook_comment_{{thread.id}}_data.
When the external resource is processed and generated as a desk thread with threadId 2980928, the key will be replaced as facebook_comment_2980928_data and the value given in the extra.value will be stored for the key facebook_comment_2980928_data in that app's DB storage. Later the app can lookup the DB storage from the widget with the key facebook_comment_2980928_data to get the value of the likes count.



    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Get started with Zoho Sign

            in a few quick steps!

            Download Help Guide





                      Still can't find what you're looking for?

                      Write to us:  support@zohoforms.com


                            




                          

                        Zoho Marketing Automation

                          Zoho Sheet Resources

                           




                              Zoho Forms Resources


                                Secure your business
                                communication with Zoho Mail


                                Mail on the move with
                                Zoho Mail mobile application

                                  Stay on top of your schedule
                                  at all times


                                  Carry your calendar with you
                                  Anytime, anywhere




                                        Zoho Sign Resources

                                          Sign, Paperless!

                                          Sign and send business documents on the go!

                                          Get Started Now


                                              Zoho SalesIQ Resources



                                                  Zoho TeamInbox Resources



                                                          Zoho DataPrep Resources



                                                            Zoho DataPrep Demo

                                                            Get a personalized demo or POC

                                                            REGISTER NOW


                                                              Design. Discuss. Deliver.

                                                              Create visually engaging stories with Zoho Show.

                                                              Get Started Now











                                                                                    • Related Articles

                                                                                    • Data Access - Minimum

                                                                                      This guide will help with you the following: Overview Return Syntax Things to keep in mind Example Overview The minimum function in the "aggregate records" deluge task returns the smallest value of a specified field from records fetched using a ...
                                                                                    • Data Access - Maximum

                                                                                      This guide will help you with the following: Overview Return Syntax Things to keep in mind Examples Overview The maximum function in the "aggregate records" deluge task returns the largest value of a specified field from records fetched based on ...
                                                                                    • Data Access - Add Records

                                                                                      This guide will help you with the following: Overview Return Syntax Things to keep in mind Applicable data-type and expression for each field Example Overview The add record deluge task creates a new record with given values in the specified form. ...
                                                                                    • Data types

                                                                                      This guide will help you with the following: Text Number Decimal Boolean Data-time Time List Key-value Text data type The text, or string, datatype represents a sequence of characters. These characters can be text characters, special characters, ...
                                                                                    • Data Access - Update records

                                                                                      This guide will help you with the following: Overview Syntax Applicable data-type and expression for each field Things to keep in mind Example Overview The update records deluge task updates(replaces) the value of a specified field with the given ...
                                                                                    Wherever you are is as good as
                                                                                    your workplace

                                                                                      Resources

                                                                                      Videos

                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                      eBooks

                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                      Webinars

                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                      CRM Tips

                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                        Zoho Show Resources