-
Notifications
You must be signed in to change notification settings - Fork 13.5k
setAvatar Rest API gives statuscode null #16110
Copy link
Copy link
Closed
Description
Description:
When is access the api/v1/users.setAvatar api end point with credentials in the header and avataUrl and Username in the data, i am getting Statuscode null error
Steps to reproduce:
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://domain/api/v1/users.setAvatar')
http = Net::HTTP.new(uri.host, 443)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.request_uri)
req['X-Auth-Token'] = userAuth
req['X-User-Id'] = userId
req['Content-Type'] = 'application/json'
req.body = {
"username" => @uid,
"avatarUrl" => "imageurl"
}.to_json
@response = http.request(req)
res = JSON.parse(@response.body)
Expected behavior:
{
"success":true
}
Actual behavior:
{
"success": false,
"error": "Cannot read property 'statusCode' of null"
}
Server Setup Information:
- Version of Rocket.Chat Server: 2.1.0
- Operating System: ubuntu
- Deployment Method: docket
- Number of Running Instances: 1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels