Simon,<div><br></div><div>Looks like %2f was needed here. It was weird because my browser/ruby client handled &quot;/api/permissions///&quot; just fine, but not one more level deep.�</div><div><br></div><div>Thanks,</div><div>
Allan<br><br><div class="gmail_quote">On Tue, Apr 10, 2012 at 12:22 PM, Simon MacMullen <span dir="ltr">&lt;<a href="mailto:simon@rabbitmq.com">simon@rabbitmq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/04/2012 5:07PM, Allan Feid wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;ve been trying to use the API to create user permissions, but this<br>
seems to fail. According to the documentation<br>
/api/permissions/vhost/<u></u>username should return the permissions for that<br>
user, but this fails with a 404. Using /api/permissions/vhost does show<br>
all the usernames properly, so I figured I&#39;d try to run PUT against the<br>
username path, and that too fails with a 404. What is the proper request<br>
to add/change permissions for a user? I attempted to use<br>
/api/users/username/<u></u>permissions, but that returns a method not allowed<br>
for PUT requests, as I expected.<br>
</blockquote>
<br>
Hi. Are you sure you are getting the username right? This works for me:<br>
<br>
$ curl -i -u guest:guest -H &quot;content-type:application/<u></u>json&quot; -XPUT \<br>
 �-d&#39;{&quot;configure&quot;:&quot;foo&quot;,&quot;write&quot;:<u></u>&quot;bar&quot;,&quot;read&quot;:&quot;baz&quot;}&#39; \<br>
 �<a href="http://localhost:55672/api/permissions/%2f/guest" target="_blank">http://localhost:55672/api/<u></u>permissions/%2f/guest</a><br>
HTTP/1.1 204 No Content<br>
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>
Date: Tue, 10 Apr 2012 16:15:58 GMT<br>
Content-Type: application/json<br>
Content-Length: 0<br>
<br>
$ curl -i -u guest:guest -H &quot;content-type:application/<u></u>json&quot; \<br>
 �<a href="http://localhost:55672/api/permissions/%2f/guest" target="_blank">http://localhost:55672/api/<u></u>permissions/%2f/guest</a><br>
HTTP/1.1 200 OK<br>
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>
Date: Tue, 10 Apr 2012 16:16:55 GMT<br>
Content-Type: application/json<br>
Content-Length: 73<br>
Cache-Control: no-cache<br>
<br>
{&quot;user&quot;:&quot;guest&quot;,&quot;vhost&quot;:&quot;/&quot;,&quot;<u></u>configure&quot;:&quot;foo&quot;,&quot;write&quot;:&quot;bar&quot;<u></u>,&quot;read&quot;:&quot;baz&quot;}<br>
<br>
Cheers, Simon<br>
</blockquote></div><br></div>