Solved

Unable to Update Requester via API (missing_params)

  • 27 March 2024
  • 1 reply
  • 42 views

Badge +1

Hello,

 

I’m attempting to use the API to update a requester, of which I have been able to pull the information for with no problem. Unfortunately, when following the examples listed in the API documentation, I am entirely unable to get the sample code to work when supplying my own data.

 

The example listed in the API documentation for updating a requester is:

curl -v -u api_key:X -H 'Content-Type: application/json' -X PUT -d '{ "first_name":"Ronald", "last_name":"Weasley","time_format":"24h" }' 'https://domain.freshservice.com/api/v2/requesters/888'

 

I am modifying this command as such:

curl.exe -u "$($ApiKey):x" -H 'Content-Type: application/json' -X PUT -d '{ "first_name":"First","last_name":"Last","time_format":"12h" }' 'https://domain.freshservice.com/api/v2/requesters/01234567891'

 

When I execute this request, I receive the error:

Status: 400

{"code":"missing_params","message":"Your update call does not have any parameter. Atleast one parameter is required."}

 

I can confirm that the requester user ID I am providing is an existing user, and I am able to retrieve information using a “GET” request, but have been unable to update the user information using a “PUT” request.

 

Does anyone have any idea why this is happening? I don’t see any practical difference between what I am doing and what is listed in the documentation.

icon

Best answer by volcanicdove 1 April 2024, 16:59

View original

1 reply

Badge +1

For the record, support was entirely unable to assist me with this issue, but I was able to track down what was going wrong.

 

I was using curl via Powershell, which requires all double quotes contained inside single quotes to be escaped with a backslash (‘ \”for example\” ’).

Reply