uvdesk / api-bundle

API Integration for UVdesk Community Helpdesk System.
MIT License
17 stars 14 forks source link

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

Open byrebg opened 1 year ago

byrebg commented 1 year ago

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

komal-sh-27 commented 1 year ago

@byrebg

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:

image

Once you check after that clear the cache of your project using this command:

php bin/console c:c

Kind Respects, Uvdesk Team

 

byrebg commented 1 year ago

@Komal-sharma-2712 , Thanks for your response.

We had done the changes as mentioned in the tutorial - https://www.uvdesk.com/en/blog/api-resource/ Also attached is screen shot of the changes done image

We have tested multiple api for tickets

Get All ticket is failing. So Is there soemthing else missed ?

Any hints will be helpful. Also from exception on cross checking the code https://github.com/uvdesk/api-bundle/blob/6ef4f4cbe69e1cb72454d2c2fec70970cfeeecca/API/Tickets.php#L76