logan
logan copied to clipboard
Access and add comments to Todos
Perhaps this is more a feature request, but it'd be nice to grab comments on todos and add comments to todos (unless I missed this somewhere).
It's not in there yet - something I can definitely add in the next week or so.
@StephenLovell - 96ed8c4203af7bdc48b80c0d29a66da7c8a8d172 handles part of this.
Now, if you have a todo you can call comments
to have it grab the comments on the todo for you (if they exist).
I'll keep this to-do open because you can't add comments yet.
The other thing is that the comment content is not stripped of any html or weird unicode characters. I think it makes to keep it this way so if you're sticking it in a webpage it will be formatted as it is on basecamp, but am open to suggestions on this one.
I am trying to write a small ruby library, which is trying to add a comment to a todo, but it is not working, is there any way that can I achieve it ?
NOTE: All other things are working like adding a todo, todolist etc.., ===================MY CODE================= params={ :content => "Test comment", :subscribers => [<oneValidIDHere>] }
Logan::Client.post "/projects/<myProjectIDHere>/todos/<MyToDoIDHere>/comments.json",params
Response seems: #<HTTParty::Response:0x..fb6daf758 parsed_response="403 Forbidden", @response=#<Net::HTTPForbidden 403 Forbidden readbody=true>, @headers={"connection"=>["close"], "x-content-type-options"=>["nosniff"], "x-runtime"=>["0.018705"], "server"=>["nginx"], "content-type"=>["text/html; charset=utf-8"], "transfer-encoding"=>["chunked"], "x-xss-protection"=>["1; mode=block"], "date"=>["Thu, 25 Sep 2014 10:42:09 GMT"], "x-frame-options"=>["SAMEORIGIN"], "set-cookie"=>["X-Runtime=0.018705; path=/; expires=Thu, 25-Sep-2014 10:42:19 GMT; secure", "X-Request-Id=ceac140a-81d2-4782-8d17-047b1531ecc3; path=/; expires=Thu, 25-Sep-2014 10:42:19 GMT; secure"], "status"=>["403 Forbidden"], "x-request-id"=>["ceac140a-81d2-4782-8d17-047b1531ecc3"], "x-queue-time"=>["0.0014562606811523438"], "cache-control"=>["no-cache"], "vary"=>["Accept-Encoding"]}>
Thanks, Kannan
Hey @kannannadarajan - it looks like you're not authenticated to make that request.
Have you given logan a set of credentials to use?
Hi Birarda,
I have the access, but I forgot to send the header! to me it is fixed.
So, I modified my code as
body = Hash.new body[:content]= "Another test with subscriber" body[:subscribers] = [8240532]
params = Hash.new params[:headers] = Logan::Client.headers.merge({'Content-Type' => 'application/json'}) params[:body] = body.to_json
logan.class.post "/projects/<projectidHere>/todos/<todoidHere>/comments.json", params
Note: I am using your older version gem(0.0.7), it is 100% fit to me, since i am working with the lower version of ruby/rails (1.8.7/1.2.1).
Thanks for your valuable contribution, Kannan
Hi, Is there any way to access all my todos across all projects and todo lists ?
Thanks, Kannan
@kannannadarajan I think as far as I have it setup now you'd have to enumerate via projects and then todolists
Feel free to open up another issue if you'd like to make a feature request!
Sure and I will share if I found anything! Thanks.