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:
const mergeTickets = async (sourceTicketId: string, targetTicketId: string) => {
const orgId = await getOrgId(); //shortcut method for returning the orgID
const request = {
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:
- {
- "data": {
- "statusMessage": {
- "errorCode": "METHOD_NOT_ALLOWED",
- "message": "This HTTP method is not allowed on this URL."
- },
- "status": "true"
- },
- "type": "application/json",
- "name": "Untitled"
- }
Here is my plugin-manifest.json
{
"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
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.