Hello,
I'm having some trouble working with the API. Specifically the client.update_avatar command.
Code kinda looks like this:
client = DiscourseApi::Client.new("#{APIHOST}")
client.api_key = APIKEY
client.api_username = APIUSER
puts client.categories
and that all works
a few lines later, this statement does not work:
puts client.update_avatar(username: myuser, url: "https://someurl")
The failure I'm getting is:
/var/lib/gems/2.3.0/gems/discourse_api-0.10.1/lib/discourse_api/client.rb:79:in `post': {"failed"=>"FAILED"} (DiscourseApi::Error)
from /var/lib/gems/2.3.0/gems/discourse_api-0.10.1/lib/discourse_api/api/users.rb:24:in `update_avatar'
from ./forum_auto_permissions.rb:96:in `block in <main>'
from /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:187:in `block in each'
from /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:186:in `upto'
from /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/xml/node_set.rb:186:in `each'
from ./forum_auto_permissions.rb:82:in `<main>'
I'm a bit stuck. This piece of code worked last Oct/Nov when I did a proof of concept on the software. Any help would be appreciated.
Thanks!
ps. I'm using the generic Oauth2 plugin if that matters. It works perfectly.