api-bundle icon indicating copy to clipboard operation
api-bundle copied to clipboard

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

Open byrebg opened this issue 2 years ago • 2 comments

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

byrebg avatar Jul 06 '23 15:07 byrebg

@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

 

komal-sh-27 avatar Jul 07 '23 11:07 komal-sh-27

@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 ticket by ID : Works
  • Post of ticket : Works
  • Delete of ticket : Works

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

byrebg avatar Jul 08 '23 14:07 byrebg

image

Working fine.

papnoisanjeev avatar Dec 16 '24 12:12 papnoisanjeev