Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add APIs to validate message objects #268

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

zenizh
Copy link
Member

@zenizh zenizh commented Oct 24, 2022

This PR resolves #267.

APIs to validate message objects have been added, and we would like to add the features to the SDK. 5 APIs have been added, but the request body, response, etc. are the same.

For reference, I tested the following code in a local environment.

require 'line/bot'

def client
  @client ||= Line::Bot::Client.new { |config|
    config.channel_id = 'xxx'
    config.channel_secret = 'xxx'
    config.channel_token = 'xxx'
  }
end

messages = [
  {
    type: 'text',
    text: 'Hello, world'
  }
]

client.validate_reply_message_objects(messages)      #=> #<Net::HTTPOK 200 OK readbody=true>
client.validate_push_message_objects(messages)       #=> #<Net::HTTPOK 200 OK readbody=true>
client.validate_multicast_message_objects(messages)  #=> #<Net::HTTPOK 200 OK readbody=true>
client.validate_narrowcast_message_objects(messages) #=> #<Net::HTTPOK 200 OK readbody=true>
client.validate_broadcast_message_objects(messages)  #=> #<Net::HTTPOK 200 OK readbody=true>

@zenizh zenizh merged commit 239362c into line:master Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validating message objects
2 participants