Re: REST API call to create a new review request

265 views
Skip to first unread message

Christian Hammond

unread,
Oct 1, 2012, 4:34:18 PM10/1/12
to Andy Paladino, reviewb...@googlegroups.com
Oh, you're uploading as JSON data. We require HTTP POST data. That's your biggest problem.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Oct 1, 2012 at 1:16 PM, Andy Paladino <Andy.P...@citrix.com> wrote:
Hi. Thanks for the response. I did update the url used to use review-requests and I'm getting a different error.  To recap, I am trying to generate a new review request via REST using a post.  Can someone tell me what I am doing wrong? I am new to reviewboard. Thanks.


apaladino$ curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExBHy=" -X POST "<review board url>/api/review-requests/" -d  "{ \"repository\": 1, \"changenum\": 678516 }"
{"fields": {"{ \"repository\": 1, \"changenum\": 678516 }": ["Field is not supported"], "repository": ["This field is required"]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}}


Andy P

From: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>
Reply-To: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>
Date: Monday, October 1, 2012 12:56 PM
To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>
Subject: Re: REST API call to create a new review request

__________________________________
Type your response ABOVE THIS LINE to reply
________________________________
Andy P
Subject: REST API call to create a new review request
________________________________
OCT 01, 2012  |  12:56PM PDT
Christian Hammond replied:
Hi Andy,

Looks like you probably want the /api/review-requests/ path. Note the -.

The reviewboard-dev mailing list may be useful to you for further questions, as there are several people on there who make use of the API.
- Christian
________________________________
OCT 01, 2012  |  09:32AM PDT
Original message
Andy wrote:

Hi. Is there a way to create a new review request using REST? We are using version 1.6.3. I tried something like this but doesn't work.

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExMTc=" -X POST "https://<reviewboard address>/api/reviewrequests/" -d "{ \"repository_path\": "perforce.ad.corp.expertcity.com", \"changenum\": \"678516\" }"


________________________________
This message was sent to andy.p...@citrix.com<mailto:andy.p...@citrix.com> in reference to Case #: 203.



[[d50dabb981a4fc3e77aae01b4c30420076c1ff85-64945104]]

Christian Hammond

unread,
Oct 1, 2012, 5:05:02 PM10/1/12
to Andy Paladino, reviewb...@googlegroups.com
The ?blah is GET query args. You can specify HTTP POST form data using:

curl -k -H "Auth......" -X POST -d repository=1 -d changenum=678516 http://<url>/api/review-requests/


Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Oct 1, 2012 at 1:54 PM, Andy Paladino <Andy.P...@citrix.com> wrote:
Ah, I see.  Should this work then?

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExBHy=" -X POST "<review board url>/api/review-requests/?repository=1&changenum=678516"


Andy P
From: Christian Hammond <chi...@chipx86.com<mailto:chi...@chipx86.com>>
Date: Monday, October 1, 2012 1:34 PM

To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>

Subject: Re: REST API call to create a new review request

Oh, you're uploading as JSON data. We require HTTP POST data. That's your biggest problem.

Christian

--
Christian Hammond - chi...@chipx86.com<mailto:chi...@chipx86.com>

Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Oct 1, 2012 at 1:16 PM, Andy Paladino <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>> wrote:
Hi. Thanks for the response. I did update the url used to use review-requests and I'm getting a different error.  To recap, I am trying to generate a new review request via REST using a post.  Can someone tell me what I am doing wrong? I am new to reviewboard. Thanks.


apaladino$ curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExBHy=" -X POST "<review board url>/api/review-requests/" -d  "{ \"repository\": 1, \"changenum\": 678516 }"
{"fields": {"{ \"repository\": 1, \"changenum\": 678516 }": ["Field is not supported"], "repository": ["This field is required"]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}}


Andy P

From: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>>
Reply-To: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>>
Date: Monday, October 1, 2012 12:56 PM
To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>>
Subject: Re: REST API call to create a new review request

__________________________________
Type your response ABOVE THIS LINE to reply
________________________________
Andy P
Subject: REST API call to create a new review request
________________________________
OCT 01, 2012  |  12:56PM PDT
Christian Hammond replied:
Hi Andy,

Looks like you probably want the /api/review-requests/ path. Note the -.

The reviewboard-dev mailing list may be useful to you for further questions, as there are several people on there who make use of the API.
- Christian
________________________________
OCT 01, 2012  |  09:32AM PDT
Original message
Andy wrote:

Hi. Is there a way to create a new review request using REST? We are using version 1.6.3. I tried something like this but doesn't work.

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExMTc=" -X POST "https://<reviewboard address>/api/reviewrequests/" -d "{ \"repository_path\": "perforce.ad.corp.expertcity.com<http://perforce.ad.corp.expertcity.com>", \"changenum\": \"678516\" }"


________________________________
This message was sent to andy.p...@citrix.com<mailto:andy.p...@citrix.com><mailto:andy.p...@citrix.com<mailto:andy.p...@citrix.com>> in reference to Case #: 203.



[[d50dabb981a4fc3e77aae01b4c30420076c1ff85-64945104]]


Andy Paladino

unread,
Oct 8, 2012, 2:00:01 PM10/8/12
to Christian Hammond, Andy Paladino, reviewb...@googlegroups.com
Thanks. I did get this to work using your suggestion. However, I am unable to do a PUT using Java now. I tried to create a new topic for this in good reviewboard-dev groups but I don't think it went through.

Andy P

From: Christian Hammond <chi...@chipx86.com<mailto:chi...@chipx86.com>>
Date: Monday, October 1, 2012 2:05 PM
To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>
Cc: "reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com>" <reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com>>
Subject: Re: REST API call to create a new review request

The ?blah is GET query args. You can specify HTTP POST form data using:

curl -k -H "Auth......" -X POST -d repository=1 -d changenum=678516 http://<url>/api/review-requests/

Christian

--
Christian Hammond - chi...@chipx86.com<mailto:chi...@chipx86.com>
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Oct 1, 2012 at 1:54 PM, Andy Paladino <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>> wrote:
Ah, I see. Should this work then?

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExBHy=" -X POST "<review board url>/api/review-requests/?repository=1&changenum=678516"


Andy P
From: Christian Hammond <chi...@chipx86.com<mailto:chi...@chipx86.com><mailto:chi...@chipx86.com<mailto:chi...@chipx86.com>>>
Date: Monday, October 1, 2012 1:34 PM
To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>>
Cc: "reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com><mailto:reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com>>" <reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com><mailto:reviewb...@googlegroups.com<mailto:reviewb...@googlegroups.com>>>
Subject: Re: REST API call to create a new review request

Oh, you're uploading as JSON data. We require HTTP POST data. That's your biggest problem.

Christian

--
Christian Hammond - chi...@chipx86.com<mailto:chi...@chipx86.com><mailto:chi...@chipx86.com<mailto:chi...@chipx86.com>>
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Mon, Oct 1, 2012 at 1:16 PM, Andy Paladino <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>> wrote:
Hi. Thanks for the response. I did update the url used to use review-requests and I'm getting a different error. To recap, I am trying to generate a new review request via REST using a post. Can someone tell me what I am doing wrong? I am new to reviewboard. Thanks.


apaladino$ curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExBHy=" -X POST "<review board url>/api/review-requests/" -d "{ \"repository\": 1, \"changenum\": 678516 }"
{"fields": {"{ \"repository\": 1, \"changenum\": 678516 }": ["Field is not supported"], "repository": ["This field is required"]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}}


Andy P

From: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>>>
Reply-To: Support <sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com><mailto:sup...@beanbaginc.com<mailto:sup...@beanbaginc.com>>>>
Date: Monday, October 1, 2012 12:56 PM
To: Microsoft Office User <Andy.P...@citrix.com<mailto:Andy.P...@citrix.com><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com><mailto:Andy.P...@citrix.com<mailto:Andy.P...@citrix.com>>>>
Subject: Re: REST API call to create a new review request

__________________________________
Type your response ABOVE THIS LINE to reply
________________________________
Andy P
Subject: REST API call to create a new review request
________________________________
OCT 01, 2012 | 12:56PM PDT
Christian Hammond replied:
Hi Andy,

Looks like you probably want the /api/review-requests/ path. Note the -.

The reviewboard-dev mailing list may be useful to you for further questions, as there are several people on there who make use of the API.
- Christian
________________________________
OCT 01, 2012 | 09:32AM PDT
Original message
Andy wrote:

Hi. Is there a way to create a new review request using REST? We are using version 1.6.3. I tried something like this but doesn't work.

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExMTc=" -X POST "https://<reviewboard address>/api/reviewrequests/" -d "{ \"repository_path\": "perforce.ad.corp.expertcity.com<http://perforce.ad.corp.expertcity.com><http://perforce.ad.corp.expertcity.com>", \"changenum\": \"678516\" }"


________________________________
This message was sent to andy.p...@citrix.com<mailto:andy.p...@citrix.com><mailto:andy.p...@citrix.com<mailto:andy.p...@citrix.com>><mailto:andy.p...@citrix.com<mailto:andy.p...@citrix.com><mailto:andy.p...@citrix.com<mailto:andy.p...@citrix.com>>> in reference to Case #: 203.



[[d50dabb981a4fc3e77aae01b4c30420076c1ff85-64945104]]


Christian Hammond

unread,
Oct 8, 2012, 2:56:17 PM10/8/12
to Andy Paladino, reviewb...@googlegroups.com
We moderate posts from new users, and people were just unavailable until now I guess.


Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


Reply all
Reply to author
Forward
0 new messages