Custom function in Zoho Flow to use Zoho Analytics API to sync data between Zoho Analytics and Zoho Desk

Custom function in Zoho Flow to use Zoho Analytics API to sync data between Zoho Analytics and Zoho Desk

Hello,

I want to use Refetch ata Endpoint: https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/datasources/<datasource-id>/sync

In Zoho Desk, we use the Zoho Analytics integration to synchronise data from Desk to Analytics. Since we want to automatically process a report, I want to reload the data via API before the export job is created and the data is sent to another service. That's when I noticed the "Sync Data" function, which seems to do exactly what I want.  So in Zoho Flow I created a custom function and set up a connection to Analytics, named "analytics" in this example. So I tested the call as follows:

  1. header = Map();
  2. header.put("ZANALYTICS-ORGID",XXXXXXXXXXX);
  3. refetchData = invokeurl
  4. [
  5.  url :"https://analyticsapi.zoho.eu/restapi/v2/workspaces/XXXXXXXXXXX/views/XXXXXXXXXXX/sync"
  6. type :POST
  7. headers:header
  8. connection:"analytics"
  9. ];
  10. info refetchData;

Unfortunately, I receive an error message as a result:

  1. "status": "failure",
  2. "summary": "INVALID_OAUTHSCOPE",
  3. "data": {
  4. "errorCode": 8540,
  5. "errorMessage": "This API request cannot be processed using the provided token. Kindly make sure that the token was created using the required scope."
  6. }

The connection that I set up in Zoho Flow has all rights, of course. On the documentation page of the Analytics API, I saw that username and password have to be passed in the CONFIG... what is this about?



The data source is the Desk integration in Zoho Analytics... there is no specific password, is there?



Regards,
Sven

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now