Skip Menu |

This queue is for tickets about the RT-Extension-REST2 CPAN distribution.

Report information
The Basics
Id: 125035
Status: open
Priority: 0/
Queue: RT-Extension-REST2

People
Owner: Nobody in particular
Requestors: aaronk4576 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Change change owner of ticket via API
Date: Sat, 7 Apr 2018 18:26:24 -0400
To: bug-RT-Extension-REST2 [...] rt.cpan.org
From: Aaron Kovacs <aaronk4576 [...] gmail.com>
The following command returns the error “Could not resolve host Owner": curl -X PUT -H "Content-Type: application/json" -u 'root:password' -d ‘{ “Owner”: {“id”: “root”}}’ http://10.0.0.26:8080/REST/2.0/ticket/5 Without being able to change nested ticket values much of the usefulness of the api is limited. Any help appreciated, Aaron
Hey, On Sat Apr 07 18:26:47 2018, aaronk4576@gmail.com wrote: Show quoted text
> The following command returns the error “Could not resolve host > Owner":
This error is coming from curl, not RT. There are several things wrong with your curl command. The payload is: ‘{ “Owner”: {“id”: “root”}}’ The single and double quotes are Unicode characters. They need to be ASCII, so: ' and ". When you change the owner, you need to specify the id, not another hash. The correct command is: curl -X PUT -H "Content-Type: application/json" -u 'root:password' -d '{ "Owner": 1 }' http://10.0.0.26:8080/REST/2.0/ticket/5 Where the ID passed in to Owner is the actual ID, for me it was 12 (go figure). Cheers, Andrew