Hotline Logo freshchat

Start a new topic

db.get

Hello guys,


I ma struggling with API

https://developers.freshdesk.com/v2/docs/data-storage/


I am using (code example below), and getting all the time record not found.

However this record is there I can see it via.

https://domain.freshdesk.com/api/v2/tickets/4


All is happening inside app that is called on location : "cti_global_sidebar"


Any ideas? Thanks!


function searchForContact () {
client.db.get("ticket:4").then (
function(data) {
console.log('data', data)
},
function(error) {
console.log('error', error)
// failure operation
});
}

Hello Michal,


The data store is only for storing/retrieving data that the app itself puts in there. Data that is stored inside Freshdesk such as Ticket details have to be retrieved using the REST APIs. 


Can you give us a few more details about the use case of the app? We will be able to suggest the best way to approach it.



Hey Rohit!


I am so happy you replied that fast. Thank you Sir.

What I am trying to achieve is that I want to create a CTI Adapter. 


So I've created app that is showed inside Freshdesk in global sidebar.

The functionalities I am trying to get are working are:

- click to dial

- search for ticket/contact

- add ticket/contact

- add ticket note


I can create server-side application to do it via API calls. One question for API do you support CORS? (so I'l now up front is should I go with server/client site).


Have a nice day!


Hmm I can't see my answer.


What I wrote a minute before was I am trying to do a CTI Adapter.


Already created a plugin that is visible in cti global sidebar.

I need to get those functionalities:


- click to dial

- search for a contact/ticket

- route to a ticket/contact

- add comment to a ticket


Hope to achieve that without API call and authentication, but must is a must.


Thanks

Hello Michal,


Let me attempt to give you some pointers for your questions.


* Search for ticket/contact - You will have to use the Freshdesk REST APIs for the same. 

https://developer.freshdesk.com/api/#filter_tickets

https://developer.freshdesk.com/api/#filter_contacts


* Route to a ticket/contact - You can use the Interface APIs available to your CTI app

https://developer.freshdesk.com/v2/docs/interface-api/#ticketnavigate

https://developer.freshdesk.com/v2/docs/interface-api/#contactnavigate


* Add comment to a ticket - You can use the Freshdesk REST API again for the same.

https://developer.freshdesk.com/api/#reply_ticket

https://developer.freshdesk.com/api/#add_note_to_a_ticket


The app supports CORS requests by allowing you to make calls via a Proxy. Check out - https://developer.freshdesk.com/v2/docs/request-api/


You will have to use APIs and authentication for the same. Your app can require an API key to be provided as an installation parameter. See https://developer.freshdesk.com/v2/docs/installation-parameters/ for more details on how to get that and use it. 


Do check out our sample app repository for examples as well - https://developer.freshdesk.com/v2/docs/sample-apps/


Login or Signup to post a comment