Describe for tickets

As i understand tickets APIs are standard REST APIs. So, where is the ticket/describe? i dont see it documented.

I want to get ticket metadata as whats the field name, type and label.

Regards

Hey @IT_Management,

Welcome to the Freshworks developer community :slight_smile:

could you check if the ticket fields endpoint works for you?
https://developer.freshdesk.com/api/#ticket-fields

Hope this helps!

2 Likes

This one is not useful as returns

    {
        "id": 66000058219,
        "name": "requester",
        "label": "Search a requester",
        "description": "Ticket requester",
        "position": 0,
        "required_for_closure": false,
        "required_for_agents": true,
        "type": "default_requester",
        "default": true,
        "customers_can_edit": true,
        "label_for_customers": "Requester",
        "required_for_customers": true,
        "displayed_to_customers": true,
        "created_at": "2020-08-04T16:43:01Z",
        "updated_at": "2020-08-04T16:43:01Z",
        "portal_cc": false,
        "portal_cc_to": "company"
      },
      {
        "id": 66000058229,
        "name": "company",
        "label": "Company",
        "description": "Ticket Company",
        "position": 1,
        "required_for_closure": false,
        "required_for_agents": true,
        "type": "default_company",
        "default": true,
        "customers_can_edit": true,
        "label_for_customers": "Company",
        "required_for_customers": true,
        "displayed_to_customers": true,
        "created_at": "2020-08-04T16:43:01Z",
        "updated_at": "2020-08-05T07:28:08Z"
      },

the fields does not have proper data type. type default_requester etc makes no sense. If you fire a view ticket API then data is

    {
      "cc_emails": [],
      "fwd_emails": [],
      "reply_cc_emails": [],
      "ticket_cc_emails": [],
      "fr_escalated": false,
      "spam": false,
      "email_config_id": null,
      "group_id": null,
      "priority": 3,
      "requester_id": 66000585005,
      "responder_id": 66000555941,
      "source": 3,
      "company_id": 66000008339,
      "status": 3,
      "subject": "Laptop does not start",
      "association_type": null,
      "support_email": null,
      "to_emails": null,
      "product_id": null,
      "id": 9,
    ...

i don’t see any mapping between what data is retuned and ticket_fields API. Any service compliance to REST needs to have a describe returning exactly mapping metada.

1 Like

anyone on this please?

1 Like

Hi @IT_Management,

Can you exactly describe what you are trying to achieve? If the API structure is blocking you on something, we can figure out a solution for it. However, if it’s more along the lines of feedback, we can forward the same to the Freshdesk team.

3 Likes

Well we are trying provide ability for our customers to pick a few fields as per their business need using our custom UI. This requires us to pull all the fields with the data type (or what is called metadata which is the sole function of a REST describe).

With no describe REST we cant do that as the ticket_fields api does not really return fields with the exact basic data type etc.

1 Like

Would it be feasible to treat the unrecognizable data types as string? As almost all Freshdesk fields in the end are strings (with a few exceptions)

1 Like

Well it still is useless. For example this API returns field

 {
    "id": 66000058225,
    "name": "group",
    "label": "Group",
    "description": "Ticket group",
    "position": 7,
    "required_for_closure": false,
    "required_for_agents": false,
    "type": "default_group",
    "default": true,
    "customers_can_edit": false,
    "label_for_customers": "Group",
    "required_for_customers": false,
    "displayed_to_customers": false,
    "created_at": "2020-08-04T16:43:01Z",
    "updated_at": "2020-08-04T16:43:01Z",
    "choices": {
      "Account managers": 66000034950,
      "Billing": 66000034945,
      "Customer Support": 66000034947,
      "Development": 66000034949,
      "Escalations": 66000034946,
      "Login and security": 66000034948,
      "Product Management": 66000034942,
      "QA": 66000034943,
      "Sales": 66000034944
    }
  }

however, there is actually no real attribute with name group. There is one with group_id . I don’t see a way to figure that out based on ticket_fields api

1 Like

@IT_Management, Did you try to see the responses by making sample API calls to these APIs? Do they also seem to respond with similar responses?

1 Like

nod sure if understood. which apis are for default_group or default_company etc. ? Be able to get complete metadata of an object using describe is a REST standard. Not sure why its so messy for tickets. Please advise how to get the complete metadata for all ticket fields

1 Like

Sorry for my ignorance. I am not able to interpret describe is a REST Standard with a way I can help you. I can only theoretically understand from this section of w3 docs. If it’s possible can you please share good examples(or links) of how you expect the API documentation could have been more helpful?

My current understanding

  1. Your Web Application with custom UI is trying to make it easier for Freshdesk users to pick few ticket fields as needed.
  2. Your application is expecting Freshdesk APIs to give you list of ticket fields for a particular Freshdesk Account.
  3. The problem comes in when the response doesn’t have details of which Data Type does a particular ticket field hold. Is it a String? Is it a Number? Is it a Boolean?
  4. This resulted in having things like default_group within "type" attribute made no sense and needing for meta data. I assume this is also where you question something related to describe REST standard.

Is my understanding so far correct? If not please correct me.

If yes, I would want to further clarify,

What kind of meta data are you hoping to get? Let’s say if there’s a ticket field called Status with possible values of Open, Closed, etc. What would the meta data look like? Should that be in the response object of Ticket Fields API or should that be just described in the documentation? or both?

1 Like

@IT_Management are you looking for something like a Swagger spec ?

1 Like

Well you undersood correct. Now let me simplify it a bit.

At the end, I need an API (call it describe or whatever) that just gives me a list of all ticket attributes present with its data type.

Currently, I do not see the listed ticket-fields API giving clear information that I can use. For example, there is a field called group_id. But the ticket_fields API have no mention of it.

I need it only from the API as we are building a generic interface that relies on this metadata to list available fields.

2 Likes

Well swagger is a way to implement. And yes anything that i can make a call to get all the object fields and its data type is enough.

1 Like

@IT_Management

I checked with the :freshdesk: team. The team has considered this as a gap and would plan to address it. In order to be tracked, I will have this topic converted into a feedback topic. Apologies, if you haven’t found what you were looking for.

1 Like