13K Views

API Resource | UVdesk Open Source Helpdesk

Updated 3 January 2024

Facebook Linkedin

Introduction

The UVdesk Opensource API correlates with the Representational State Transfer category (REST) that allows to performance of several ticket-related operations like fetching all tickets, deleting tickets, creating a new ticket, and loading ticket data. These API’s can be used to perform the ticket-related operations in the Helpdesk system to other third-party applications.

This API includes all the information about the tickets such as ticket Id, subject, ticket status, priority, groups, and others.

However, to achieve this job you have to integrate an API bundle first with your installed helpdesk project.

Video Tutorial

How to get API call resource?

Follow the below steps to get the integration done:

Step 1: Open the root directory in the terminal and run the below command:

This will create a separate bundle for your helpdesk project. You can achieve this by navigating through Dashboard –> Settings –> API similar to below screenshot:

Step 2: After installing the API bundle run the below command:

This command will update the helpdesk database value as well as the doctrine ORM.

Note: The above commands should not be used in the production mode.

Step 3: API Access Token

Once you click on the API button, it will redirect you to the API access token page. Here you can access API credentials.

Click on the API credential button from the top right corner as shown below:

Once you click on the “Access Credentials” button it will ask you the token name. Give the name and enable credentials then save it.

Once you click on the Save credentials button, you’ll get the access token similar to the below screenshot. Here, you can also see the created date for the creation of the API access token.

Although, you can also disable or delete API tokens with the help of the respective button.

After that, you have to make the following changes in security.yaml file by navigating through config –>> packages –>> security.yaml. 

Do the simple changes in the position of uvdesk_api, just place it after the back support in firewalls or before the customer function as shown below:

Check API Using Postman:

Example: Getting all tickets using API  

 

 

UVdesk Forum!        Developer Visit!            Contact Us!         Live Demo!

Category(s) API Symfony UVdesk
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


10 comments

  • Andrea Costa
    Looks nice! I did some test, creating, listing ticket, everything ok… but I got the following error on: POST /api/v1/ticket/2/thread

    Here is the curl command:

    curl -v -H “Authorization: Basic N1RA8J7OQNZBO0WJD0WV73U5TX1HNODBQDKAXYBWELQUE5NKYXQNMAB9CEFNNTDL” -H “Content-Type: application/json” -d ‘{“message”:”Messaggio di risposta”, “actAsEmail”:”mario.rossi@superfattura.it”, “actAsType”:”customer”, “threadType”: “reply”}’ -X POST http://localhost/api/v1/ticket/2/thread
    Note: Unnecessary use of -X or –request, POST is already inferred.
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0* Trying 51.77.211.136:80…
    * Connected to localhost (51.77.211.136) port 80 (#0)
    > POST /api/v1/ticket/2/thread HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.69.1
    > Accept: */*
    > Authorization: Basic N1RA8J7OQNZBO0WJD0WV73U5TX1HNODBQDKAXYBWELQUE5NKYXQNMAB9CEFNNTDL
    > Content-Type: application/json
    > Content-Length: 126
    >
    } [126 bytes data]
    * upload completely sent off: 126 out of 126 bytes
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 500 Internal Server Error
    < Server: nginx
    < Date: Mon, 11 May 2020 16:02:36 GMT
    < Content-Type: application/json
    < Content-Length: 82
    < Connection: keep-alive
    < Vary: Authorization
    < Set-Cookie: PHPSESSID=k9cvfd8j2ali4grvu52n8b1fla; path=/; HttpOnly; SameSite=lax
    < Cache-Control: max-age=0, must-revalidate, private
    < Access-Control-Allow-Origin: *
    < Access-Control-Allow-Methods: GET,POST,PUT,OPTIONS
    < Access-Control-Allow-Headers: Access-Control-Allow-Origin
    < Access-Control-Allow-Headers: Authorization
    < Access-Control-Allow-Headers: Content-Type
    < pragma: no-cache
    < Expires: Mon, 11 May 2020 16:02:36 GMT
    < X-Debug-Token: 322b1d
    < X-Debug-Token-Link: http://localhost/_profiler/322b1d
    < X-Robots-Tag: noindex
    <
    { [82 bytes data]
    100 208 100 82 100 126 245 377 –:–:– –:–:– –:–:– 626{"status":false,"message":"An unexpected error occurred. Please try again later."}
    * Connection #0 to host localhost left intact

    Thank you
    Regards
    AC

    • Himani Gupta (Moderator)
      Hello Andrea Costa,
      Nice day to you!!
      Have you tried the same with the Postman? Kindly try it via postman and let us know if it still exists?
      Thanks for using our community software and your effort.
      Kind Respects
      UVdesk Team
  • Arunachalam
    Hi,

    In the uvDESK community edition, after configuring the API following this doc https://www.uvdesk.com/en/blog/api-resource/ and when accessing through the postman got this error in the dev.log file.

    [2020-08-01 01:07:51] request.INFO: Matched route “uvdesk_api_bundle_api_tickets_v1.0_fetch_tickets”. {“route”:”uvdesk_api_bundle_api_tickets_v1.0_fetch_tickets”,”route_parameters”:{“_route “:”uvdesk_api_bundle_api_tickets_v1.0_fetch_tickets”,”_controller”:”Webkul\\UVDesk\\ApiBundle\\API\\Tickets::fetchTickets”},”request_uri”:”http://172.16.122.41/uvdesk/helpdesk-project/publi c/api/v1/tickets”,”method”:”GET”} []
    [2020-08-01 01:07:51] security.DEBUG: Checking for guard authentication credentials. {“firewall_key”:”uvdesk_api”,”authenticators”:1} []
    [2020-08-01 01:07:51] security.DEBUG: Checking support on guard authenticator. {“firewall_key”:”uvdesk_api”,”authenticator”:”Webkul\\UVDesk\\ApiBundle\\Security\\Guards\\APIGuard”} []
    [2020-08-01 01:07:51] security.DEBUG: Calling getCredentials() on guard authenticator. {“firewall_key”:”uvdesk_api”,”authenticator”:”Webkul\\UVDesk\\ApiBundle\\Security\\Guards\\APIGuard”}

    The postman response windows got this error..

    {
    “status”: false,
    “message”: “An unexpected error occurred. Please try again later.”
    }

    What could be the issue ? How to debug furthur ?

    From
    Arunachalam

    • Komal Sharma (Moderator)
      Hello Arunachalam,

      We have checked but we are not able to reproduce like this issue in API bundle. Let us know if it still exists? Can you please share your composer.json and composer.lock file. You can please share on the our official uvdesk forums. Please follow the below link:

      https://forums.uvdesk.com/

      Also, you can create a ticket on our support helpdesk from here:

      https://support.uvdesk.com/en/customer/create-ticket/

      Kind Respects
      UVdesk Team

  • Joseph
    Please fix this page – https://www.uvdesk.com/en/api-doc/. The contents do not show when you click the menu. Thanks.
    • Himani Gupta (Moderator)
      Hello Joseph
      Above shared page is working as expected. You can visit this page effortlessly and get the API of SaaS(cloud-based) helpdesk – uvdesk
      Thanks & Regards
      UVdesk Team
  • leo
    Hello,

    Thank you so much about the informations but where is the last updated API documentation ?

    The doc online is totaly different : https://www.uvdesk.com/en/api-doc/

    Thanks,
    Léo

    • Komal Sharma (Moderator)
      Hello leo,

      You have mentioned the link, this is a saas uvdesk API doc:

      https://www.uvdesk.com/en/api-doc/

      For opensource uvdesk API link, you can visit on the below link:

      https://github.com/uvdesk/api-bundle/wiki/Ticket-Related-APIs

      Thanks & Regards
      UVdesk Team

  • Alexandre Bueno
    It follows the procedures, but when clicking to generate the key it gave this error. Can you help me?

    {“status”:false,”message”:”Invalid credentials provided.”,”error_code”:”API-002″}

    • Komal Sharma (Moderator)
      Hello Alexandre Bueno,

      We have checked but we are not able to reproduce this issue in API bundle. Can you please share your composer.json and composer.lock file. You can please share on the our official uvdesk forums. Please follow the below link:

      https://forums.uvdesk.com/

      Also, you can create a ticket on our support helpdesk from here:

      https://support.uvdesk.com/en/customer/create-ticket/

      Kind Respects
      UVdesk Team