Class: FamilyappSdk::Client
- Inherits:
-
Object
- Object
- FamilyappSdk::Client
- Defined in:
- lib/familyapp_sdk/client.rb
Class Method Summary collapse
- .get_family(family_id) ⇒ Object
- .send(family_id, conversation_id, data) ⇒ Object
- .update_profile(family_id, family_user_id, data) ⇒ Object
Class Method Details
.get_family(family_id) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/familyapp_sdk/client.rb', line 5 def self.get_family(family_id) url = "/bot_api/v1/families/#{family_id}" RestClient.get( FamilyappSdk.config.api_host + url, { Authorization: FamilyappSdk.config.access_token } ) { |response, request, result| response } end |
.send(family_id, conversation_id, data) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/familyapp_sdk/client.rb', line 22 def self.send(family_id, conversation_id, data) url = "/bot_api/v1/families/#{family_id}/conversations/#{conversation_id}/messages" RestClient.post( FamilyappSdk.config.api_host + url, data.build.to_json, { Authorization: FamilyappSdk.config.access_token, content_type: :json } ) { |response, request, result| response } end |
.update_profile(family_id, family_user_id, data) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/familyapp_sdk/client.rb', line 13 def self.update_profile(family_id, family_user_id, data) url = "/bot_api/v1/families/#{family_id}/family_users/#{family_user_id}" RestClient.patch( FamilyappSdk.config.api_host + url, data, { Authorization: FamilyappSdk.config.access_token } ) { |response, request, result| response } end |