Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
byrebg opened this issue Jul 6, 2023 · 2 comments

Comments

@byrebg
Copy link

byrebg commented Jul 6, 2023

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
Copy link

@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
Copy link
Author

byrebg commented Jul 8, 2023

@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

'user' => $this->getUser()->getId(),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants