Desk Invoke API

Desk Invoke API

Desk's invoke API acts as a proxy between the extension and the External Services or Desk for calling the APIs.

With Desk Invoke API,
  1. Can access the Zoho Desk's APIs
  2. Can access the External Services's APIs
  3. Can access the Extension Data Specific APIs such as storage, configParam and log APIs

Using Desk Invoke API

The query parameters such as orgId , securityContext and headerparam HASH are required for calling Invoke API . orgId & securityContext will be provided by desk during the Platform event callbacks. HASH should be generated using the SECRET and the Request URL inputs. Refer Generating Hash for Invoke API

#INVOKE_API_REQUEST_PAYLOAD



INVOKE API REQUEST FORMAT:

URL             :     api/v1/invoke
RequestMethod   :     POST
QueryParams     :     orgId
RequestHeaders  :     HASH
Content-Type    :     application/x-www-form-urlencoded
RequestBody     :     #INVOKE_API_REQUEST_PAYLOAD.

INVOKE API RESPONSE FORMAT:

ResponseCode    : 200
Content-Type    : application/json
Response        : #INVOKE_API_RESPONSE_OBJECT

Generate Hash for Invoke API

To call invoke API, HASH is mandatory. Hash is used to verify the invoke API call was originally made by the extension developer. HASH is an HMAC sha256 encrypted string with the key as app's secret (manifest.secret) provided in the manifest and the input as invokeAPI's payload.

Desk also will generate the HASH with the shared app's secret with the provided payload in the invoke API and will match the provided HASH in the desk invoke API's header. If the HASH does not match with the desk generated HASH, then the invoke API will not be processed.

The same process of authentication can be used by the extension during the extension callback events to verify the callback was originally sent by the desk.

Sample of Invoke API HASH Generation
If manifest.secret => "my_secret_key_238392"

For Sample Invoke API Inputs =>
requestURL          = https://api.google.com/test
requestType         = POST
queryParams         = {}
postBody            = {}
headers             = {"orgId":376723}
connectionLinkName  = myConnectionLinkName

(*ignore what you don't need)'

Hash generation would be =>

then, generated HASH = hmac_sha256 ( stringToHash, "my_secret_key_238392" );


Note: While generating HASH, only include the parameters which will be used in the 
 invoke API.
Order of the fields while generating hash should be exactly 
1.requestURL
2.requestType
3.queryParams
4.postBody
5.headers
6.connectionLinkName
and you can ignore the fields which you don't send.

Specifying Placeholders in Invoke API

You can specify configParams, authentication details as placeholders while calling the desk invoke API. The placeholders will be replaced with the original values before sending the request to requestURL.

Supported placeholders


Specifying Authentication Details in Invoke API

Invoke API applies the authentication details specified while calling the API, find the below table for specifying the authentication details while calling the invoke API.


Sample of Specifying Connection in invokeAPI payload
  1. ...
  2. requestURL         = https://api.google.com/test
  3. connectionLinkName = googleConnection
  4. ...                  

#INVOKE_API_RESPONSE_OBJECT

Sample Response :
{
  1.   "responseHeaders" : {
  2.     "Cache-Control" : "private,no-cache,no-store,max-age=0,must-revalidate",
  3.     "Set-Cookie" : "drecn=9e1f7200-bcdf-426d-9628-79ff4e9241c8; Path=/; Secure",
  4.     "Vary" : "Accept-Encoding",
  5.     "Expires" : "Thu, 01 Jan 1970 00:00:00 GMT",
  6.     "X-XSS-Protection" : "1",
  7.     "Content-Type" : "application/json;charset=utf-8"
  8.   },
  9.   "response" : "{\"data\":[{\"ticketNumber\":\"176\",\"customerResponseTime\":\"2014-03-22T05:05:08.471Z\",\"productId\":null,\"contactId\":\"1892000000045028\",\"subject\":\"from forum\",\"dueDate\":\"2016-06-01T14:04:07.000Z\",\"departmentId\":\"1892000000006907\",\"channel\":\"Forums\",\"threadCount\":\"72\",\"priority\":\"High\",\"assigneeId\":\"1892000000056007\",\"closedTime\":null,\"commentCount\":\"0\",\"phone\":null,\"contact\":{\"firstName\":\"\",\"lastName\":\"as\",\"phone\":null,\"id\":\"1892000000045028\",\"type\":null,\"email\":\"manojkumar.s+4444@zohocorp.com\",\"account\":{\"website\":\"qwe.com\",\"accountName\":\"Man_Account\",\"id\":\"1892000000980421\"}},\"createdTime\":\"2014-03-06T09:49:50.000Z\",\"id\":\"1892000000094004\",\"email\":\"example@example.com\",\"status\":\"Open\"}]}",
  10.   "statusCode" : "200"
  11. }




                        



    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

                                                                                      • Push-Data to Desk

                                                                                        Whenever you need to manually push tickets & threads to the desk, you can use the following API. This API expects the payload in the #SYNC_RESPONSE_OBJECT format. To call desk's "channels/import" API, orgId and securityContext params are mandatory. ...
                                                                                      • Pull Request from Desk

                                                                                        Desk periodically invokes a request to the endpoint specified in the extension manifest's channel.sync.pull property. Pull requests are made every 4 minutes from the desk. You can send the new/ updated data of tickets and threads that needs to be ...
                                                                                      • Push Reply from Desk

                                                                                        When an agent replies from the desk for a ticket or thread created by channel integration, the reply is pushed to the Resources.channel.sync.push endpoint of the app which needs to be delivered to the external service so that the reply will be ...
                                                                                      • Invoke APIs

                                                                                        Below are some extra APIs that you can use in your extension.  ROUTE_TO INSERT MODAL_CLOSE RESIZE ROUTE_TO This command navigates between the multiple subtabs on the ticket detail page. Listed below are the different routes supported: ...
                                                                                      • Invoke Connector Task

                                                                                        This guide will help you with the following:       1. Syntax       2. Example After a connector is published and associated with an extension or vertical solution, it can be invoked whenever necessary. You can invoke a connector using a custom ...
                                                                                      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