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

Send satifaction with API not allowed #17640

Closed
2 tasks done
cuicui86 opened this issue Aug 2, 2024 · 1 comment
Closed
2 tasks done

Send satifaction with API not allowed #17640

cuicui86 opened this issue Aug 2, 2024 · 1 comment
Labels

Comments

@cuicui86
Copy link

cuicui86 commented Aug 2, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

GLPI 10.0.6

Bug description

We have the API configuration with "Enable login with external token" and when try to send a satisfaction using API.
We get a 05 Method Not Allowed.

The GET method works to retrive the Satisfaction for the ticket.

Relevant log output

Client error: `PUT https://glpitest.fr/TicketSatisfaction/5/` resulted in a `405 Method Not Allowed` response:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>405 Method Not Allowed</title>
    </head><body>
    <h1> (truncated...)

Page URL

No response

Steps To reproduce

Step to reproduce :

  1. Enable the internal satisfaction.
  2. Create a ticket
  3. Set solution and approuve it to set ticket in Closed status

Use the API to get the Satisfaction survey :
`
$this->connect($instance);
$response = $this->getClient($instance)->request('GET', 'Ticket/' . $ticket .'/TicketSatisfaction/',
[ 'headers' => $this->getHeaders($instance, 'application/json') ]
);

$satisfactionData = json_decode($response->getBody());

// Prepare the data
$data = [
'tickets_id' => $ticket,
'satisfaction' => $satisfaction,
'comment' => $comment
];

// Send the satisfaction
$this->connect($instance);
$response = $this->getClient($instance)->request('PUT', '/TicketSatisfaction/' . $satisfactionData[0]->id . '/',
[
'headers' => $this->getHeaders($instance,'application/json'),
'json' => [ 'input' => $data ],
]
);

// Display the return
dd(json_decode($response->getBody()));
`
When run the code with all correct data to use the API Rest we get an error.

Your GLPI setup information

No response

Anything else?

No response

@trasher trasher added the support label Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

This issue has been closed as we only track bugs here.

You can get community support on forums or you can consider taking a subscription to get professional support.
You can also contact GLPI editor team directly.

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

No branches or pull requests

2 participants