Calling POST method on Zoho Desk API using ZOHODESK.request method results in "This HTTP Method is not allowed" error

Calling POST method on Zoho Desk API using ZOHODESK.request method results in "This HTTP Method is not allowed" error

Hi,

I'm trying to merge 2 tickets using the ZohoDesk API, triggered from my Zoho Desk Extension.

I'm using the Zoho Desk Merge Tickets API do to this.  I've tested this API separately in PostMan, so can confirm that it is working.

When I try to replicate this call from my extension, using a configured connection and and the `ZOHODESK.Request` method, I get back an object with error code "Method Not Allowed" and message "This HTTP method is not allowed on this URL."

This is an endpoint that requires using HTTP POST.  I've had no trouble with GET methods using ZOHODESK.Request.  Do I need to somehow enable the connection for POST methods?

Here is the code that is calling the merge method:

  1. const mergeTickets = async (sourceTicketId: string, targetTicketId: string) => {
      const orgId = await getOrgId(); //shortcut method for returning the orgID
      const request = {
        url: `https://desk.zoho.com/api/v1/tickets/${sourceTicketId}/merge`,
        type: 'POST',
        headers: { 'Content-Type': 'application/json', orgId: orgId },
        connectionLinkName: 'myzohodeskconnnection',
        responseType: 'json',
        postBody: { ids: [targetTicketId] },
        data: {}
      };


      const response = await ZOHODESK.request(request);
      console.log('Merge Response', response);
      return response;
    };
Here is the logged response:

  1. {
  2.     "data": {
  3.         "statusMessage": {
  4.             "errorCode": "METHOD_NOT_ALLOWED",
  5.             "message": "This HTTP method is not allowed on this URL."
  6.         },
  7.         "status": "true"
  8.     },
  9.     "type": "application/json",
  10.     "name": "Untitled"
  11. }

Here is my plugin-manifest.json

  1. {
      "locale": [
        "en"
      ],
      "service": "DESK",
      "storage": true,
      "type": "personal",
      "whiteListedDomains": [
      ],
      "modules": {
        "widgets": [
          //removed for brevity
        ]
      },
      "cspDomains": {
        "connect-src": []
      },
      "zohoAuthorisation": {},
      "connectors": [
        {
          "connectionLinkName": "myzohodeskconnnection",
          "connectionName": "My Zoho Desk Connnection",
          "serviceName": "zlabs_integration",
          "userAccess": true,
          "isUserDefinedService": false,
          "sharedBy": "633754463",
          "scope": [
            "Desk.tickets.ALL",
            "Desk.tasks.ALL",
            "Desk.settings.ALL",
            "Desk.search.READ",
            "Desk.extensions.ALL",
            "Desk.zia.ALL",
            "Desk.contacts.ALL",
            "Desk.basic.ALL",
            "Desk.articles.ALL",
            "Desk.calls.ALL",
            "Desk.events.ALL",
            "Desk.community.ALL",
            "Desk.activities.READ",
            "Desk.products.READ",
            "Desk.imports",
            "Desk.integrations.ALL",
            "Desk.products.UPDATE",
            "Desk.activities.CREATE",
            "Desk.activities.DELETE",
            "Desk.custommodule.ALL"
          ]
        }
      ],
      "config": [],
      "moduleSupport": true
    }

I look forward to finding out what I'm doing wrong

    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