Method: Line::Bot::V2::MessagingApi::ApiClient#get_group_member_profile_with_http_info

Defined in:
lib/line/bot/v2/messaging_api/api/messaging_api_client.rb

#get_group_member_profile_with_http_info(group_id:, user_id:) ⇒ Array(Line::Bot::V2::MessagingApi::GroupUserProfileResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})

Get group chat member profile This requests to GET https://api.line.me/v2/bot/group/{groupId}/member/{userId} This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.

Parameters:

  • group_id (String)

    Group ID

  • user_id (String)

    User ID

Returns:

  • (Array(Line::Bot::V2::MessagingApi::GroupUserProfileResponse, Integer, Hash{String => String}))

    when HTTP status code is 200

  • (Array((String|nil), Integer, Hash{String => String}))

    when other HTTP status code is returned. String is HTTP response body itself.

See Also:



873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/line/bot/v2/messaging_api/api/messaging_api_client.rb', line 873

def get_group_member_profile_with_http_info( # steep:ignore MethodBodyTypeMismatch 
  group_id:, 
  user_id:
)
  path = "/v2/bot/group/{groupId}/member/{userId}"
    .gsub(/{groupId}/, group_id.to_s)
    .gsub(/{userId}/, user_id.to_s)

  response = @http_client.get(
    path: path,
  )

  case response.code.to_i
  when 200
    json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
    json.transform_keys! do |key|
      Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
    end
    response_body = Line::Bot::V2::MessagingApi::GroupUserProfileResponse.create(json) # steep:ignore InsufficientKeywordArguments
    [response_body, 200, response.each_header.to_h]
  else
    [response.body, response.code.to_i, response.each_header.to_h]
  end
end