Cannot create ticket in API, INVALID_DATA error returned against valid json.
Hi,
I'm trying to use the API to create a ticker, and I and getting an unusual error back when I post up data to create a ticket.
I have called the API endpoint to list the departments, and I am taking the id field from one of the ones listed and putting it as the departmentId in the following object that is being sent up.
- {
- "subject": "Posted from Web API",
- "departmentId": "00000000000000000", //Removed actual value
- "description": "I was created by the Web API!",
- "contact": {
- "firstName": "First",
- "lastName": "Last",
- "email": "ValidEmailAddressHere",
- "phone": "01234567890",
- "cf": null
- },
- "productId": null,
- "email": "ValidEmailAddressHere",
- "phone": "01234567890",
- "cf": null
- }
When I post this up I get the following error back
- {"errorCode":"INVALID_DATA","message":"The data is invalid due to validation restrictions","errors":[{"fieldName":"/departmentId","errorType":"invalid","errorMessage":""}]}
I am not escaping the names of the parameters, I am using Newtonsoft.Json to serialize and RestSharp to make these requests so they are generating a valid json body for the request that appears correctly in any of the debug inspectors, so I'm not sure why it is being rejected, so I'm unsure where the issue is coming from, I am not using any specialized serializers or anything like that, I have a couple of C# POCO classes that reflect the structure defined in the API docs at
https://desk.zoho.com/support/APIDocument.do#Tickets and
https://desk.zoho.com/support/APIDocument.do#Contacts and I have tests to show that they serialize to json that matches the samples in the docs. Is there a specific approach preferred when calling the API from .Net code, should I need a custom serializer or tweak the default serialization settings?
Thanks for any help.
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
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
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.