25K Views

API Resource | UVdesk Open Source Helpdesk

Introduction

The UVdesk Opensource API correlates with the Representational State Transfer category (REST) that allows to perform several ticket related operation like fetching all tickets, deleting ticket, creating a new ticket and load ticket data. These API’s can be used to perform ticket related operation in 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 make the integration done:

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

$ composer require uvdesk/api-bundle

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

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

$ php bin/console doctrine:schema:update --force

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

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

Step 3: API Access Token

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

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

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

Once you’ll click on 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 API access token.

Although, you can also disable or delete API token 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 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
. . .

Comments (2)

Add Your Comment

  • 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
      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
  • css.php