Method: Line::Bot::V2::Liff::ApiClient#add_liff_app_with_http_info
- Defined in:
- lib/line/bot/v2/liff/api/liff_client.rb
#add_liff_app_with_http_info(add_liff_app_request:) ⇒ Array(Line::Bot::V2::Liff::AddLiffAppResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Adding the LIFF app to a channel This requests to POST https://api.line.me/liff/v1/apps This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/line/bot/v2/liff/api/liff_client.rb', line 58 def add_liff_app_with_http_info( # steep:ignore MethodBodyTypeMismatch add_liff_app_request: ) path = "/liff/v1/apps" response = @http_client.post( path: path, body_params: add_liff_app_request, ) 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::Liff::AddLiffAppResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] when 400 [response.body, 400, response.each_header.to_h] when 401 [response.body, 401, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |