GithubHelp home page GithubHelp logo

uvdesk / api-bundle Goto Github PK

View Code? Open in Web Editor NEW
17.0 11.0 14.0 117 KB

API Integration for UVdesk Community Helpdesk System.

License: MIT License

PHP 86.01% Twig 13.99%
uvdesk-api-bundle ticket-management create-ticket view-ticket fetch-all-tickets trash-ticket

api-bundle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-bundle's Issues

When we added multiple access token on our admin panel then copy the below token using copy button then always copy on the first token only

Description
When we added multiple access token on our admin panel then copy the below token using copy button then always copy on the first token only

How to reproduce
Create an api access token and copy the 2nd token so here copy the first token instead of click copy token details:

image

Possible Solution
When click on copy token so here should be copy the same access token

Get /api/v1/tickets fails with - Call to a member function fails - Tickets.php

Description

Url : /api/v1/tickets
On invoking the get all tickets fails with error " Call to a member function getId() on null"

image

It works completely fine on fetching the individual ticket.
Url : /api/v1/ticket/1

image

How to reproduce
After installing the API bundle within the container
image

Any hints or suggestions will be greatly appreciated

API giving 404

https://www.uvdesk.com/en/blog/api-resource/

I installed the API using the following guide the above guide, however when I attempt to pull for example tickets.json or similar using curl I get back a "404: We were not able to find the page you are looking for." page instead.

Am I missing a step here? The API section of the panel is available, and a token has been created.

If we are creating a ticket from the postman side, click on ticket view showing an error

Description
If we are creating a ticket from the postman side, click on ticket view showing an error

How to reproduce
Step 1: Ticket created with this case and send:

message : (your message)
actAsType : (agent)
actAsEmail: (any customer email)
name: (customer name)
subject: (Ticket subject)
from: (Agent Email)

API-agent,agent-id,cust-id

Step 2: Now go to the admin panel and click on the created ticket with this case after clicking on it shows an error:

image

Possible Solution
If we create a ticket and click on the ticket should be open

how can i post formatted message to api create?

I need to know how can I post formatted message to uvdesk api create.
I tried to send message with full html tags, and all html tags were sanitized.
I tried again using php htmlentities() htmlspecialchars(), converting html tags (limited to p, br and a) to ascii counterpart but it is also sanitized.
Can you please help me?
Thanks in advance

another error on update customer data

Description
UvDesk API bundle tickets filtration use actAsType="customer" and actAsEmail="email.address" as main identification
This resulting our customers losing their ticketing after they change their email address.
So I tried to submit email change using route /api/v1/customers/update/{customerId}
But I got the following error message returned

{
    "status": false,
    "message": "Class \"Webkul\\UVDesk\\ApiBundle\\API\\UserPasswordEncoderInterface\" does not exist"
}

How to reproduce
As example I used customerId 8
Use this route /api/v1/customers/update/8
Use method POST (this route will not work using PUT)
Send in JSON format data that I want to changed, in this case the email address, for example

{
    "email": "[email protected]"
}

Create new ticket with attachment

Hi!

I am using Python to create new tickets with this code:

import requests

headers = {"Authorization": "Bearer TOKEN"}

payload = {
    "message": "Ticket Message",
    "actAsType": "customer",
    "name": "Name",
    "subject": "Ticket Subject",
    "from": "[email protected]",
}

r = requests.post("http://my_server/api/v1/ticket", data=payload, headers=headers)

print r.content

Now I want to know how can I create this same ticket but with attachment.

Thanks!

When create an agent from api side then group, team, agent-priv, ticket-view option added

Description
When create an agent from api side then group, team, agent-priv, ticket-view option added

How to reproduce
Step 1: Create an agent from postman api side then added all params in form data:

Screenshot from 2023-06-05 18-24-25

Step 2: Now send this request and here showing an error like this:

Screenshot from 2023-06-05 17-05-43

Step 3: Now check on the admin panel here agent created successfully:

image

Also, not choose or added group and team option in created agent:

image

Also, not choose any ticket view option and agent privilege:

image

Possible Solution
If we are using the create agent from postman api side then should be added all option in agent on the admin panel

Pagination (lazy load) when fetching data

Description
Is there an option to set limits and offset by fetching data like "all tickets" ?
The response includes only 15 items and it seems there is no way to get more than that.

When we using the wrong email from postman api side in agent and customer created and updated time so here should be shown a warning message instead of agent created on the admin dashboard

Description
When we using the wrong email from postman api side in agent and customer created and updated time so here should be shown a warning message instead of agent created on the admin dashboard

How to reproduce
Step 1: When we used the wrong email from the postman side in agent and customer account created time then here showing an error but also agent and customer created successfully on the admin panel without showing any warning:

Screenshot from 2023-06-23 18-05-06

On admin panel:

image

Step 2: When we updated the agent and customer then here updated with wrong email address from the postman api side instead of showing an warning:

image

Possible Solution
If we have created or updated with wrong email so here should be shown a warning message like admin panel:

This is not a valid email address

When we using the raw format for create agent api then here showing an error

Description
When we using the raw format for create agent api then here showing an error

How to reproduce
Step 1: Added a details for creating agent in raw option like this:

{
    "firstName": "lazer",
    "lastName": "angelov",
    "role": "ROLE_AGENT",
    "email": "[email protected]",
    "contactNumber": "8178563000",
    "isActive": "false",
    "signature": "lazer angelov",
    "designation": "QA",
    "agentPrivilege": ["2"],
    "userSubGroup": ["3"],
    "groups": ["2"],
    "ticketView": "2"
}

Step 2: Then send api and here showing an error like this: "Notice: Undefined index: email"

Screenshot from 2023-06-05 17-48-53

Note: Same params we have using with the data form then agent created successfully.

Possible Solution
If we have added data with raw format so here should be create an agent from postman api side.

API GET tickets ActAsType customer

Description
Fetching all Tickets actAsType: customer responds with wrong list , same as agent, full long list of all tickets.

How to reproduce
API GET tickets ActAsType customer

Possible Solution
line 34 $data['actAsEmail'] not defined in api-bundle/API/Tickets.php
line 45 similar

I can't assign a ticket using the API

Description

I'm trying to assign a ticket to a particular agent.
As suggested by the API documentation (https://github.com/uvdesk/api-bundle/wiki/Ticket-Related-APIs) I tried:
To send a PUT request to this endpoint: {my_localhost_url}/api/v1/ticket/{ticketId}/agent.
I assume that "agent", after the last slash, is the id of the agent you want to assign the ticket, isn't it?

The API response that I got is this:

{
    "status": false,
    "message": "No route found for \"PUT /api/v1/ticket/2/4\""
}

I should say that I've verified and the agent id exists.
Same thing for the ticket which id is 2.

How to reproduce

To reproduce this issue:

  1. Donwload and install uvdesk-community-skeleton.
  2. Install the api-bundle.
  3. Set up your api, following these steps: https://www.uvdesk.com/en/blog/api-resource/.
  4. Open Postman and try to assign a ticket using the above mentioned method.

Thanks in advance!

Can not reply a thread

How to reproduce
I created a ticket using the API
Screenshot from 2020-12-10 19-20-04

I made a post request http://localhost:8000/api/v1/ticket/1/thread to reply the thread, and below is the body
{ "message":"why should I Help you", "actAsType":"customer", "actAsEmail":"[email protected]", "threadType":"reply" }
This is the response and no error message in the terminal
{ "status": false, "message": "An unexpected error occurred. Please try again later." }

Ticket channel should be API when ticket creates from postman API side

Description
The ticket channel should be API when the ticket creates from the postman API side

How to reproduce
Step 1: Ticket creates from postman API side
Step 2: Now go to the admin panel, and click on the tickets for ticket view page here show the channel is website instead of the API channel:

image

Possible Solution
If we are creating a ticket from the API side should be channel shown API like this:

image

Note: On the tickets list page already shows channel API

Should be shown a proper messages when using the session logout api

Description
Should be shown a proper messages when using the session logout api. Please follow the below cases point:

  1. If we have expired the token from session/logout api then used this same token for ticket fetch api's. Then shows an message like this:
    "message": "Invalid credentials."

Here should be shown a message like this: "This api is expired so not working, please check once again"

  1. If we have disable api token from admin dashboard then worked with this token for tickets fetch api's. Then shows an message like this:
    "message": "An authentication exception occurred."

Here should be shown a message like this: "This api is disabled from admin end, please check once again"

  1. If we have expired the token from session/logout api then used this same token for the session logout. Then shows an message like this:
    "message": "Invalid credentials."

Here should be shown a message like this: " This Session token has been already expired successfully."

Possible Solution:

Should be shown a proper message while using the below cases.

Still Cannot Create Multiple attachments for a ticket.

After testing the solution provided at: issue 12 the multiple attachments uploaded for a ticket still behaves the same, i.e If list of attachments are uploaded, it takes only the last item and uploads only one attachment.

When testing via postman, I use "attachments" key multiple times for each file I want to upload and also via my code base, I pass list of files to the attachments key, but both methods of testing still behaves the same as usual.

Would like to see the CC/BCC option when replying to a ticket

Description
When using the API i would like to set the CC adres and/or BCC adres on a thread.
So 2 additional parameters for setting CC and BCC.
Also multiple CC/BCC would be nice to have.

We have a need for this because of the following reason.
When a employee send in a ticket we need to inform there manager about the ticket also there for a CC would be nice.

When ticket is in the trashed tab should not be the agent updated

Description
When the ticket is in the trashed tab should not be the agent updated at this moment

How to reproduce
Step 1: Create a ticket and trash the ticket
Step 2: Now go to the postman and update the agent from the postman API side with the trashed ticket id

Using this API:

API URL: {helpdesk_url}/api/v1/ticket/{ticketId}

Method: [PATCH]

Authorization: Basic {API token}

Inputs for agent Update:

property: agent(property is agent)

value: agent Id(agent id)

Note:
These inputs give in body -> x-www-form-urlencoded

Step 3: Here the ticket agent is updated successfully

Possible Solution
If we are updating the agent with a trashed ticket id from the postman side should not be updated the agent because on the uvdesk helpdesk trashed ticket agent is not updated:

image

No route found

Description
I cannot query the API for customers: I get "No route found"

How to reproduce
Query for retrieving tickets works:

$ curl -X GET -H "Authorization: Basic $TOKEN" https://<domain>/api/v1/tickets

while for customers it doesn't work:

$ curl -X GET -H "Authorization: Basic $TOKEN" https://<domain>/api/v1/customers
{"status":false,"message":"No route found for \u0022GET \/api\/v1\/customers\u0022"}

I'm looking at the documentation on uvdek web site at the page https://www.uvdesk.com/en/api-doc/, but I'm getting confused because it doesn't seem to be consistent to my installation: is that documentation valid for uvdesk/api-bundle project?

Thank you
Stefano

consistency issue with the repositoies

Description
When installing I get the message

“Could not find package uvdesk/api-bundle. It was however found via repository search, which indicates a consistency issue with the repository”

When specifying a release ie
composer require uvdesk/api-bundle:1.0.4 i get the message

“Yor requirements could not be resolved to an installable set of packages” (for all releases i tried this was the answer)

min-stability is set to dev

updated composer and symfony and no change. running php 7.4

got error on customer create

Description
Got error 500 on using /api/v1/customers/create , method POST
This is the result

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

At this point I'm not sure what did I do wrong.
I tried to trace back inside api-bundle but could not even find proper customers.yaml within routes

How to reproduce
Use route /api/v1/customers/create.
Use method POST
Send as JSON the following parameters : firstName, lastName, email, contactNumber and isActive (boolean)
For example

{
    "firstName": "first",
    "lastName": "last",
    "email": "[email protected]",
    "contactNumber": "",
    "isActive": true
}

Thanks

If the ticket deletes permanently from the postman side so attachments are not deleted from the physical path: [public/assets/threads]

Description
If the ticket deletes permanently from the postman side so attachments are not deleted from the physical path:
[public/assets/threads]

How to reproduce

Step 1: Tickets delete permanently from the postman side

Step 2: Now check in the physical path of the project here are attachments not deleted from this path:

[public/assets/threads]

Possible Solution
If we delete permanently from the postman side so attachments should be deleted from the physical path: [public/assets/threads]

When create a custom field with required option from the postman side, so after create custom field not taking required on the when create a ticket from admin and customer end

Description
When create a custom field with required option from the postman side, so after create custom field not taking required on the when create a ticket from admin and customer end

How to reproduce
Step 1: Create a custom field with postman side like this:

{
"name": "Sample Custom Field",
"agentType": "both",
"fieldType": "text",
"placeholder": "Sample Custom Field Placeholder",
"status": true,
"required": true,
"encryption": false,
"sortOrder": 2,
"dependencies": [{"id": ticketTypeId}]

}

Step 2: Now check on the customer and admin side with create a ticket and submit blank the form so here not showing a required message in create ticket form:

image

Possible Solution
If we using the required field from the postman side so here also taking the required with showing a warning message like this:

image

When replying from the customer account with the postman API so not going to email to the agent side

Description
When replying from the customer account with the postman API so not going to email to the agent side

How to reproduce

Issue 1:

Step 1: Go to the postman side and reply from the customer account
Step 2: Now check the agent's email here nothing receives email notification but also going to the customer email with this email template: New Reply Added on ticket #id

image

Issue 2:

With the same steps with collaborators add in the ticket and reply from the customer or collaborators side so email notifications receive to the own customer and collaborators account but not receive email notifications to agent account.

Issue 3:

If the customer replies from the postman API side so collaborator is not added as a CC in the ticket thread like this:

image

Possible Solution
If the reply from the customer or collaborator side with the postman API side so should go to email notification to agent and collaborators side with the right email notification:

image

If a reply from the customer account from the postman side should be collaborator account added as a CC in ticket thread like this:

image

formatedCreatedAt in fetchTickets return new DateTime

Description
I found out whenever list of all tickets is requested, there is formatedCreatedAt return with odd value.
I keep getting (almost) the same result "01-01-1970 15:16am".
The only think that changed was the time at the end of formatedCreatedAt.
At first I thought "api-bundle" could not returning proper "created at" date time value from database.
But oddly enough, it can when I requested to view single ticket, I get proper createdAt and updatedAt value.

How to reproduce
by requesting to /api/v1/tickets
check within "tickets" list , all formatedCreatedAt value started with "01-01-1970"

Possible Solution
at this point i'm not sure, yet
probably because of Webkul\UVDesk\ApiBundle\API\Tickets:objectSerializer
notice this line 920 = $object->formatedCreatedAt = new \Datetime;
probably should use correct value from $object->createdAt , with proper formatting
or just return $object->createdAt and let the frontend change it formatting according what it needs.

Can anyone please help me? thanks in advance

Unable to assign ticket type when creating

Description
When creating a ticket using the api bundle it gets the default ticket type even when sending a type field with the request.

How to reproduce
Create two Ticket Types in the dashboard

  • default
  • support

Send a POST request to my-domain/api/v1/ticket with

{
    "name": "John Dow",
    "from": "[email protected]",
    "subject": "Example",
    "message": "Testing example.",
    "type": "support"
}

The newly created ticket has the default ticket type.

Possible Cause
In Webkul\UVDesk\ApiBundle\API\Tickets::createTicket we don't do anything with $data['type']

When we create and update of agent, customer, group, and team option form postman api side then should be shown a validation for special characters

Description
When we create and update of agent, customer, group, and team option form postman api side then should be shown a validation for special characters

How to reproduce
Step 1: When we create a new or update an agent, customer, group, and team field then if we using some special characters in firstname and lastname, name, description field then created or updated successfully from the postman api side instead of warning:

Screenshot from 2023-06-23 17-48-45

Step 2: Now checked on the same from the admin dashboard then here showing a warning like this:

image

Possible Solution
If we created a new agent, customer, group, team form postman api side then should be shown a warning like admin panel

This field must have characters only
This field must be a number

I can't fetch tickets belonging to a particular email

Description

I'm trying to fetch the tickets belonging to a particular user.
As suggested by the API documentation (https://github.com/uvdesk/api-bundle/wiki/Ticket-Related-APIs) I tried:
To send a GET request to this endpoint: {my_localhost_url}/api/v1/tickets?actAsEmail={[email protected]}.

The API response is the same everytime, regardless of the email parameter.
So to clarify, everytime I receive a response containing all the tickets no matter their emails.

If I try this:
{my_localhost_url}/api/v1/tickets?actAsEmail={[email protected]}&actAsType=customer
The API returns an error.

How to reproduce

To reproduce this issue:

  1. Donwload and install uvdesk-community-skeleton.
  2. Install the api-bundle.
  3. Set up your api, following these steps: https://www.uvdesk.com/en/blog/api-resource/.
  4. Open Postman and try to fetch tickets belonging to a particular email using the above mentioned method.

Thanks for your help.

create with multiple attachments

When i upload multiple attachments to uvdesk, it only uploads the last file in the set of files sent, and discards the rest.
It does not accept an array of files when creating a ticket or replying to a ticket. It only takes one.

When we are using the expired token from session logout api then token not expired/disabled from admin panel

Description
When we are using the expired token from session logout api then token not expired/disabled from admin panel

How to reproduce
Step 1: First create a token from using session login api or from admin panel on admin credentials button:

image

Step 2: Now we have api token expired from session logout api using postman side:

Headers:

{
    "Authorization": "Bearer ACCESS_TOKEN"
}

Step 3: After token expired now check on the admin panel and here this token still enabled:

image

Possible Solution

If we have api token expired from session logout api side so here should be token is expired like when click on disbaled button so here status is disabled but here should be status shown expired and also enabled button is unclickable so that we are not able to status is enabled again:

image

Note: Discussed with Akshay Sir

When using session/login api then showing an error regarding UserAccessScopes

Description
When using session/login api then showing an error regarding UserAccessScopes

How to reproduce
Step 1: Use the session login api, then api send here showing an error:

Case 1: If we are using the admin email for session login then api secret key generated on the admin HD but on PM api side showing an error like this:

Screenshot from 2023-06-05 18-04-22

Case 2: If we are using any agent email then showing an error also api secret key not generated on admin HD:

Screenshot from 2023-06-05 18-04-22

Possible Solution
If we are using the session login api with owner account or agent account so here not shoiwng an error also create an api on the admin panel

Last replied time for message

Hi
Is it possible to retrieve just headline information about a ticket without pulling all the threads etc?

For instance, we would like to retrieve the last time a new response was posted on a ticket by anyone.

If we reply with forward type this reply should not be shown on the customer side

Description
If we reply with forward type this reply should not be shown on the customer side

How to reproduce
Step 1: Reply from the postman side with forward type with agent id

Step 2: Now check on the admin panel here forward the reply added that is correct:

image

Step 3: Now check on the customer panel and here also show the agent forward reply:

image

Note: If the forward reply from admin id so reply not shown on the customer side but using agent id so reply shown on the customer panel

Possible Solution

If forward from postman side so agent forward reply should not be shown on the customer panel

If we use multiple attachments in creates tickets and replies from the postman side should be added multiple attachments

Description
If we use multiple attachments in creates tickets and replies from the postman side should be added multiple attachments

How to reproduce
Step 1: Tickets creates or reply from the postman's side with multiple attachments

Step 2: Now go to the admin dashboard and here shown only one attachment:

image

Possible Solution

If we use multiple attachments in creates tickets and replies from the postman side should be added multiple attachments

Unable to fetch or create tickets using Rest API.

I created a token for the authentication in uvdesk.
image

and I'm unable to fetch tickets using it. There is an internal server error found when trying to fetch tickets.
image

May I know what did I miss or is there any log file to trace the problem?

Unable to create ticket with attachment in Python

I am unable to create a ticket with attachments in Python.
data = {
'message': message,
'actAsType': 'customer',
'name': name,
'subject': subject,
'from':from_email,
}
if attachments:
data['attachments'] = attachments

Above is the code i am using to fill my data object. This will go into the POST request to the api.
response = requests.post(url, data=data, headers=self.headers)

The ticket is actually created, however, attachments are nowhere to be found. See response below:
{'status': 'success', 'response': {'message': 'Success! Ticket has been created successfully.', 'ticketId': 35}}

In the attachments key is a base64 string. Is this correct? What format is to be expected?

On the agent side should be added api bundle icon and also shows session login api keys on the agent panel

Description
On the agent side should be added api bundle icon and also shows session login api keys on the agent panel

How to reproduce
Step 1: Login with agent account and here should be added api bundle. Please check the below points for add the api bundle on agent panel:
On agent panel should be shown api bundle without + access credentials button
On agent panel should not be shown a disable and copy credentials button
On agent panel should be shown a session login api keys but shows a partial key (not shows complete api key)
On agent panel should be shown only a delete credentials button for agent delete only own api keys

image

Possible Solution
At this moment only api bundle option and generated api keys shows on agent panel.

Note: Discussed with Akshay Sir

When using forward reply from postman API side should be show forwarded in the ticket thread

Description
When using forward reply from postman API side should be show forwarded in the ticket thread

How to reproduce
Step 1: Reply with a forward option from the postman side

Step 2: Now go to the admin dashboard and here reply added but not showing forwarded in the ticket thread:

image

Possible Solution

If we are using a forward reply from the postman side here should be shown forwarded in the ticket thread.

If in api parameters leave space in last when create ticket then here showing an error

Description
If in api parameters leave space in last when create ticket then here showing an error

How to reproduce
Create a ticket using api side and added a api parameters with leave space in last in the below parameters, then after send request shows an error in all parameters like this: "Warning: Undefined array key "actAsType""

Name
From
Email
actAsType
Subject
Message
Attachments[0] 

Note: Only on actAsEmail parameter if leave space in last then working.
Also, if we leave space in starting then all works fine.

Possible Solution
If we have leave space in the last then should not be shown an error like this.

When replying with a note and forward option added to the customer account so should not be added as a note and forward in the tickets

Description
When replying with a note and forward option added to the customer account so should not be added as a note and forward in the ticket thread

How to reproduce
Step 1: Reply from the postman side with the note and forward option choose
Step 2: Here added actAsType and actAsEmail is customer account
Step 3: Go to the admin panel and here note and forward added from the customer account:

Note added from the customer account:

image

Forward added from the customer account:

image

Possible Solution

If we use reply add from the postman side with the customer account so should not be added a note and forwarded with the customer account because on uvdesk helpdesk from the customer side is not available the note and forward option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.