Open ca-dsgn opened 2 years ago
Hi @ca-dsgn
Thank you for using this lib! Could you try the following?
`$criteriaBuilder = new ListCriteriaBuilder();
$gateway->getOperationPool()->getListOperation('tickets', [$params["ticket_id"], 'threads'])->get($criteriaBuilder->create())`
It's not documented but you can pass extra arguments to the operation processors
Hi @thomas-kl1,
thank you for your quick reply and support on this. I really appreciate, that you share this library and that I don't have to implement it by myself completely from scratch ;-)
I inserted your snippet in my code, but I got this fatal error:
Fatal error: Uncaught Error: Call to undefined method Zoho\Desk\Model\Operation\ListOperation::get()
But I looked into the ListOperation class and checked, that the function should be getList() instead of get().
So by using
$criteriaBuilder = new ListCriteriaBuilder();
$gateway->getOperationPool()->getListOperation('tickets', [$params["ticket_id"], 'threads'])->get($criteriaBuilder->create())
I am receiving the threads of the ticket. So working perfect now. Thank you so much!
I have one more question regarding the create action for a ticket:
In your sample code you have this snippet:
$ticketDataObject = $gateway->getDataObjectFactory()->create('tickets', /* Entity values */);
try {
$ticketDataObject = $gateway->getOperationPool()->getCreateOperation('tickets')->create($ticketDataObject);
} catch (CouldNotSaveException $e) {
// Handle the exception...
}
Could you give a sample of the section / Entity values /? Is this an object, which has the same structure like the object that the get action gives back? Or is it a associative array?
Thank you very much in advance.
Best, Christian
Hi @ca-dsgn glad it helps you and it's working! Indeed the method is getList, not get, my bad..
Regarding the data object factory, the entity values must be an associative array of key-value pair. So it's easy an convenient to create generic data objects :)
If you appreciate the SDK you can add a ⭐, it helps me to who is using it :)
Hi @thomas-kl1
Ok, great. Thank you for your quick reply on this.
I have one more question:
I just realized, that the resultList objects only contain a summary property, which has a limited number of charaters and then a "..." at the end. So it is just a short summary.
In the documentation of Zoho Desk, I saw, that there should be another field "content" beside "summary", which contains the entire value of the thread. But I couldn't find this field in the response.
https://desk.zoho.com/DeskAPIDocument#Threads
Do you have any idea how to get the entire text of the thread?
@ca-dsgn seems it's not possible to get the full content within a list. So I guess you have to fetch the list to get the IDs of the thread so you can fetch them individually.
I need to check if a hack is possible or if I need to implement a new operators for subtypes. When I designed the SDK I didn't used much subtypes such as threads so it doesn't really handle all fine. However I'm thinking of adding a new method to allows it (along the setEntityType). I don't know yet when I can work on it, maybe tonight or Monday
@thomas-kl1 Wow, thank you so much for your great support!
Hi @thomas-kl1,
I just successfully fetched the data of a ticket via
The response I get is this (via print_r):
I can see in the threadCount, that there are 7 replies on this ticket. My question is, how can I get those threads?
I found this specific information in the zoho desk api documentation, but I am not sure how to implement this using your php interface:
https://desk.zoho.com/DeskAPIDocument#Threads#Threads_Listconversations
Thank you in advance for your help.
Best, Christian