Skip to content

invalid_array_arg with users_profile_set when profile is not JSON #258

Open

Description

@jaman1020

I'm trying to create a small integration that changes the user status, and am unable to do so. No matter what permutation of users_profile_set I choose, I cannot get around an invalid_array_arg error from slack.

client.users_profile_set( user: user_id, profile: { :status_text=>"anything", :status_emoji=>":house_with_garden:", :status_timeout => 1234 })

I'm positive that the User ID is correct. I can actually use this method to set an individual property, but setting the emoji property clears the status property, and vice versa. Anything involving using the "profile" hash causes the problem

Full Error:
Slack::Web::Api::Errors::SlackError: invalid_array_arg from /Users/jon/.rvm/gems/ruby-2.3.3/gems/slack-ruby-client-0.14.1/lib/slack/web/faraday/response/raise_error.rb:11:in 'on_complete'

Activity

  1. dblock commented on Mar 10, 2019

    @dblock
    Collaborator

    I have a whole bot that does that ;)

    https://github.com/dblock/slack-moji/blob/master/slack-moji/models/user.rb#L167

    The value of profile needs to be JSON. Go figure.

    Would appreciate a patch ala https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/api/patches/chat.2.attachments-json.patch in this project for the profile APIs so that users don't have to struggle.

  2. changed the title [-]invalid_array_arg with users_profile_set[/-] [+]invalid_array_arg with users_profile_set when profile is not JSON[/+] on Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions