Class: Mints::Contact
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#add_item_to_shopping_cart(data) ⇒ Object
Add Item To Shopping Cart.
-
#attach_follower(data) ⇒ Object
Attach Follower.
-
#attach_invitee(data) ⇒ Object
Attach Invitee.
-
#change_password(data) ⇒ Object
Change Password.
-
#create_appointment(data) ⇒ Object
Create Appointment.
-
#create_conversation(data) ⇒ Object
Create Conversation.
-
#create_message(data) ⇒ Object
Create Message.
-
#create_order(data) ⇒ Object
Create Order.
-
#create_order_item_group(data) ⇒ Object
Create Order Item Group.
-
#delete_order_item_group(id) ⇒ Object
Delete Order Item Group.
-
#detach_follower(data) ⇒ Object
Detach Follower.
-
#detach_invitee(data) ⇒ Object
Detach Invitee.
-
#detach_order_item_from_order_item_group(orderItemId, groupId) ⇒ Object
TODO: No tested === Detach Order Item From Order Item Group.
-
#get_appointment(id, options = nil) ⇒ Object
Get Appointment.
-
#get_appointments(options = nil) ⇒ Object
Get Appointments.
-
#get_conversation(id, options = nil) ⇒ Object
Get Conversation.
-
#get_conversation_participants(id) ⇒ Object
Get Conversation Participants.
-
#get_conversations(options = nil) ⇒ Object
Get Conversations.
-
#get_message(id, options = nil) ⇒ Object
Get Message.
-
#get_messages(options = nil) ⇒ Object
Get Messages.
-
#get_my_shopping_cart ⇒ Object
Get My Shopping Cart.
-
#get_order(id, options = nil) ⇒ Object
Get Order.
-
#get_order_item(id, options = nil) ⇒ Object
Get Order Item.
-
#get_order_item_group(id, options = nil) ⇒ Object
Get Order Item Group.
-
#get_order_item_groups(options = nil) ⇒ Object
Get Order Item Groups.
-
#get_order_items(options = nil) ⇒ Object
Get Order Items.
-
#get_orders(options = nil, use_post = true) ⇒ Object
Get Orders.
-
#initialize(host, api_key, session_token = nil, contact_token_id = nil, debug = false) ⇒ Contact
constructor
Initialize.
-
#login(email, password) ⇒ Object
Login.
-
#logout ⇒ Object
Logout.
-
#magic_link_login(token) ⇒ Object
Magic Link Login.
-
#me(options = nil) ⇒ Object
Me.
-
#oauth_login(data) ⇒ Object
OAuth Login.
-
#recover_password(data) ⇒ Object
Recover Password.
-
#register(data) ⇒ Object
Register.
-
#reset_password(data) ⇒ Object
Reset Password.
-
#scheduled_appointments(data) ⇒ Object
Scheduled Appointments.
-
#send_magic_link(email, template_slug, redirectUrl = '', lifeTime = 1440, maxVisits = nil) ⇒ Object
Send Magic Link.
-
#status ⇒ Object
Status.
-
#sync_follower(data) ⇒ Object
Sync Follower.
-
#sync_invitee(data) ⇒ Object
Sync Invitee.
-
#update(data) ⇒ Object
Update.
-
#update_appointment(id, data) ⇒ Object
Update Appointment.
-
#update_conversation(id, data) ⇒ Object
Update Conversation.
-
#update_conversation_status(id, data) ⇒ Object
Update Conversation Status.
-
#update_order(id, data) ⇒ Object
Update Order.
-
#update_order_item_from_order_item_group(orderItemId, groupId, data) ⇒ Object
TODO: No tested === Update Order Item From Order Item Group.
-
#update_order_item_group(id, data) ⇒ Object
Update Order Item Group.
Methods included from MintsHelper
#correct_json, #data_transform, #get_query_results
Constructor Details
permalink #initialize(host, api_key, session_token = nil, contact_token_id = nil, debug = false) ⇒ Contact
Initialize.
Class constructor.
Parameters
- host
-
(String) – It’s the visitor IP.
- api_key
-
(String) – Mints instance api key.
- contact_token_id
-
(Integer) – Cookie ‘mints_contact_id’ value (mints_contact_token).
Return
Returns a Contact object
18 19 20 21 |
# File 'lib/contact.rb', line 18 def initialize(host, api_key, session_token = nil, contact_token_id = nil, debug = false) @contact_v1_url = '/api/contact/v1' @client = Mints::Client.new(host, api_key, "contact", session_token, contact_token_id, nil, debug) end |
Instance Attribute Details
permalink #client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/contact.rb', line 6 def client @client end |
Instance Method Details
permalink #add_item_to_shopping_cart(data) ⇒ Object
Add Item To Shopping Cart.
Add an item into a shopping cart.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"quantity": 1,
"sku_id": 1,
"price_list_id": 1
}
@data = @mints_contact.add_item_to_shopping_cart(data)
673 674 675 |
# File 'lib/contact.rb', line 673 def add_item_to_shopping_cart(data) return @client.raw("post", "/ecommerce/shopping-cart", nil, data_transform(data), @contact_v1_url) end |
permalink #attach_follower(data) ⇒ Object
Attach Follower.
Attach follower to an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"follower_ids": 1
}
@data = @mints_contact.attach_follower(data)
476 477 478 |
# File 'lib/contact.rb', line 476 def attach_follower(data) return @client.raw("post", "/contacts/appointments/attach-follower", nil, data_transform(data)) end |
permalink #attach_invitee(data) ⇒ Object
Attach Invitee.
Attach invitee to an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"invitee_ids": 1
}
@data = @mints_contact.attach_invitee(data)
459 460 461 |
# File 'lib/contact.rb', line 459 def attach_invitee(data) return @client.raw("post", "/contacts/appointments/attach-invitee", nil, data_transform(data)) end |
permalink #change_password(data) ⇒ Object
Change Password.
Change password without email. To change the password a contact must be logged.
Parameters
- data
-
(Hash) – A new password allocated in a data key.
Example
data = { "password": "new_password" }
@data = @mints_contact.change_password(data)
226 227 228 |
# File 'lib/contact.rb', line 226 def change_password(data) return @client.raw("post", "/change-password", nil, data_transform(data), @contact_v1_url) end |
permalink #create_appointment(data) ⇒ Object
Create Appointment.
Create an appointment with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"object_model": "products",
"object_id": 1,
"title": "New Appointment",
"start": "2021-11-25T14:15:00+00:00",
"end": "2022-01-01T13:00:00+00:00"
}
@data = @mints_contact.create_appointment(data)
406 407 408 |
# File 'lib/contact.rb', line 406 def create_appointment(data) return @client.raw("post", "/contacts/appointments", nil, data_transform(data)) end |
permalink #create_conversation(data) ⇒ Object
Create Conversation.
Create a conversation with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Conversation To Test"
}
@data = @mints_contact.create_conversation(data)
267 268 269 |
# File 'lib/contact.rb', line 267 def create_conversation(data) return @client.raw("post", "/content/conversations", nil, data_transform(data), @contact_v1_url) end |
permalink #create_message(data) ⇒ Object
Create Message.
Create a message with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"conversation_id": 3,
"type": "text",
"value": {
"text": "Message Text"
}
}
@data = @mints_contact.(data)
346 347 348 |
# File 'lib/contact.rb', line 346 def (data) return @client.raw("post", "/content/messages", nil, data_transform(data), @contact_v1_url) end |
permalink #create_order(data) ⇒ Object
Create Order.
Create a order with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"order_template_id": 1,
"order_status_id": 1,
"sales_channel_id": 1
}
@data = @mints_pub.create_order(data)
608 609 610 |
# File 'lib/contact.rb', line 608 def create_order(data) return @client.raw("post", "/ecommerce/orders", nil, data_transform(data), @contact_v1_url) end |
permalink #create_order_item_group(data) ⇒ Object
Create Order Item Group.
Create an order item group with data if you are related to that order.
Parameters
- data
-
(Hash) – Data to be submited.
First Example
data = {
"name": "New Order Item Group",
"quantity": 1,
"order_id": 1,
"on_sale_price": 100
}
@data = @mints_contact.create_order_item_group(data)
Second Example
data = {
"name": "",
"quantity": 1,
"order_id": 1,
"sku_id": 1
}
@data = @mints_contact.create_order_item_group(data)
756 757 758 |
# File 'lib/contact.rb', line 756 def create_order_item_group(data) return @client.raw("post", "/ecommerce/order-items-groups", nil, data_transform(data), @contact_v1_url) end |
permalink #delete_order_item_group(id) ⇒ Object
Delete Order Item Group.
Delete an order item group. FIXME: This method doesn’t work. Throw no action error.
781 782 783 |
# File 'lib/contact.rb', line 781 def delete_order_item_group(id) return @client.raw("delete", "/ecommerce/order-items-groups/#{id}", nil, nil, @contact_v1_url) end |
permalink #detach_follower(data) ⇒ Object
Detach Follower.
Detach follower from an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"follower_ids": 1
}
@data = @mints_contact.detach_follower(data)
510 511 512 |
# File 'lib/contact.rb', line 510 def detach_follower(data) return @client.raw("post", "/contacts/appointments/detach-follower", nil, data_transform(data)) end |
permalink #detach_invitee(data) ⇒ Object
Detach Invitee.
Detach invitee from an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"invitee_ids": 1
}
@data = @mints_contact.detach_invitee(data)
493 494 495 |
# File 'lib/contact.rb', line 493 def detach_invitee(data) return @client.raw("post", "/contacts/appointments/detach-invitee", nil, data_transform(data)) end |
permalink #detach_order_item_from_order_item_group(orderItemId, groupId) ⇒ Object
TODO: No tested
Detach Order Item From Order Item Group.
Detach an order item from an order item group.
Parameters
- orderItemId
-
(Integer) – Order item id.
- groupId
-
(Integer) – Order items group id.
632 633 634 |
# File 'lib/contact.rb', line 632 def detach_order_item_from_order_item_group(orderItemId, groupId) return @client.raw("put", "/ecommerce/order-items/detach/#{orderItemId}/order-items-groups/#{groupId}", nil, nil, @contact_v1_url) end |
permalink #get_appointment(id, options = nil) ⇒ Object
Get Appointment.
Get an appointment info.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_contact.get_appointment(1)
Second Example
= {
"fields": "id, created_at"
}
@data = @mints_contact.get_appointment(1, )
386 387 388 |
# File 'lib/contact.rb', line 386 def get_appointment(id, = nil) return @client.raw("get", "/contacts/appointments/#{id}", ) end |
permalink #get_appointments(options = nil) ⇒ Object
Get Appointments.
Get a collection of appointments.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_contact.get_appointments
Second Example
= {
"fields": "id, created_at"
}
@data = @mints_contact.get_appointments()
367 368 369 |
# File 'lib/contact.rb', line 367 def get_appointments( = nil) return @client.raw("get", "/contacts/appointments", ) end |
permalink #get_conversation(id, options = nil) ⇒ Object
Get Conversation.
Get a conversation info.
Parameters
- id
-
(Integer) – Conversation id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
FIXME: This method doesn’t return data.
251 252 253 |
# File 'lib/contact.rb', line 251 def get_conversation(id, = nil) return @client.raw("get", "/content/conversations/#{id}", , nil, @contact_v1_url) end |
permalink #get_conversation_participants(id) ⇒ Object
Get Conversation Participants.
Update a conversation participants.
Parameters
- id
-
(Integer) – Conversation id.
FIXME: This method doesn’t locate conversation id to be updated.
302 303 304 305 |
# File 'lib/contact.rb', line 302 def get_conversation_participants(id) #TODO: Test if this method needs data in options. return @client.raw("get", "/content/conversations/#{id}/participants", nil, nil, @contact_v1_url) end |
permalink #get_conversations(options = nil) ⇒ Object
Get Conversations.
Get a collection of conversations.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
FIXME: This method doesn’t return data.
239 240 241 |
# File 'lib/contact.rb', line 239 def get_conversations( = nil) return @client.raw("get", "/content/conversations", , nil, @contact_v1_url) end |
permalink #get_message(id, options = nil) ⇒ Object
Get Message.
Get a message info.
Parameters
- id
-
(Integer) – Message id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
FIXME: This method doesn’t return data.
326 327 328 |
# File 'lib/contact.rb', line 326 def (id, = nil) return @client.raw("get", "/content/messages/#{id}", , nil, @contact_v1_url) end |
permalink #get_messages(options = nil) ⇒ Object
Get Messages.
Get a collection of messages.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
FIXME: This method doesn’t return data.
314 315 316 |
# File 'lib/contact.rb', line 314 def ( = nil) return @client.raw("get", "/content/messages", , nil, @contact_v1_url) end |
permalink #get_my_shopping_cart ⇒ Object
Get My Shopping Cart.
Get a collection of items in the shopping cart.
Example
@data = @mints_contact.get_my_shopping_cart
FIXME: This method returns a nil data.
655 656 657 |
# File 'lib/contact.rb', line 655 def get_my_shopping_cart return @client.raw("get", "/ecommerce/my-shopping-cart", nil, nil, @contact_v1_url) end |
permalink #get_order(id, options = nil) ⇒ Object
Get Order.
Get an order info.
Parameters
- id
-
(Integer) – Order id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_pub.get_product(25)
Second Example
= {
"fields": "title"
}
@data = @mints_pub.get_product(25, )
590 591 592 |
# File 'lib/contact.rb', line 590 def get_order(id, = nil) return @client.raw("get", "/ecommerce/orders/#{id}", , nil, @contact_v1_url) end |
permalink #get_order_item(id, options = nil) ⇒ Object
Get Order Item.
Get an order item info. TODO: Find a way to show order items.
689 690 691 |
# File 'lib/contact.rb', line 689 def get_order_item(id, = nil) return @client.raw("get", "/ecommerce/order-items/#{id}", , nil, @contact_v1_url) end |
permalink #get_order_item_group(id, options = nil) ⇒ Object
Get Order Item Group.
Get an order item group info.
Parameters
- id
-
(Integer) – Order Item Group Id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_contact.get_order_item_group(130)
Second Example
= {
"fields": "id"
}
@data = @mints_contact.get_order_item_group(130, )
728 729 730 |
# File 'lib/contact.rb', line 728 def get_order_item_group(id, = nil) return @client.raw("get", "/ecommerce/order-items-groups/#{id}", , nil, @contact_v1_url) end |
permalink #get_order_item_groups(options = nil) ⇒ Object
Get Order Item Groups.
Get a collection of order item groups.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_contact.get_order_item_groups
Second Example
= {
"fields": "id"
}
@data = @mints_contact.get_order_item_groups()
708 709 710 |
# File 'lib/contact.rb', line 708 def get_order_item_groups( = nil) return @client.raw("get", "/ecommerce/order-items-groups", , nil, @contact_v1_url) end |
permalink #get_order_items(options = nil) ⇒ Object
Get Order Items.
Get a collection of order items. TODO: Find a way to show order items.
681 682 683 |
# File 'lib/contact.rb', line 681 def get_order_items( = nil) return @client.raw("get", "/ecommerce/order-items", , nil, @contact_v1_url) end |
permalink #get_orders(options = nil, use_post = true) ⇒ Object
Get Orders.
Get a collection of orders.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
- use_post
-
(Boolean) – Variable to determine if the request is by ‘post’ or ‘get’ functions.
First Example
@data = @mints_pub.get_orders
Second Example
= { "fields": "title" }
@data = @mints_pub.get_orders()
Third Example
= { "fields": "title" }
@data = @mints_pub.get_orders(, false)
566 567 568 569 570 571 572 |
# File 'lib/contact.rb', line 566 def get_orders( = nil, use_post = true) if use_post return @client.raw("post", "/ecommerce/orders/query", , nil, @contact_v1_url) else return @client.raw("get", "/ecommerce/orders", , nil, @contact_v1_url) end end |
permalink #login(email, password) ⇒ Object
Login.
Starts a contact session.
Parameters
-
(String) – The email that will be logged.
- password
-
(String) – The password of the email.
Example
@mints_contact.login("email@example.com", "password")
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/contact.rb', line 54 def login(email, password) data = { email: email, password: password } response = @client.raw("post", "/contacts/login", nil, {data: data}.to_json) if response.key? "session_token" @client.session_token = response["session_token"] end return response end |
permalink #logout ⇒ Object
Logout.
Ends a contact session previously logged.
Example
@data = @mints_contact.logout
208 209 210 211 212 213 214 |
# File 'lib/contact.rb', line 208 def logout response = @client.raw("post", "/logout", nil, nil, @contact_v1_url) if session_token? if response["success"] @client.session_token = nil end return response end |
permalink #magic_link_login(token) ⇒ Object
Magic Link Login.
Starts a contact session with a token received in the contact email. The token will be received by send_magic_link method.
Parameters
- token
-
(String) – The email token that will be used to log in.
Example
@mints_contact.magic_link_login(
"d8618c6d-a165-41cb-b3ec-d053cbf30059:zm54HtRdfHED8dpILZpjyqjPIceiaXNLfOklqM92fveBS0nDtyPYBlI4CPlPe3zq"
)
117 118 119 120 121 122 123 |
# File 'lib/contact.rb', line 117 def magic_link_login(token) response = @client.raw("get", "/contacts/magic-link-login/#{token}", nil, '/api/v1') if response.key? "session_token" @client.session_token = response["session_token"] end return response end |
permalink #me(options = nil) ⇒ Object
Me.
Get contact logged info.
Parameters
- # options
-
(Hash) – List of Resource collection Options shown above can be used as parameter.
First Example
@data = @mints_contact.me
Second Example
= {
"attributes": true,
"taxonomies": true
}
@data = @mints_contact.me()
171 172 173 |
# File 'lib/contact.rb', line 171 def me( = nil) return @client.raw("get", "/me", , nil, @contact_v1_url) end |
permalink #oauth_login(data) ⇒ Object
OAuth Login.
Login a contact using oauth.
102 103 104 |
# File 'lib/contact.rb', line 102 def oauth_login(data) return @client.raw("post", "/contacts/oauth-login", nil, data) end |
permalink #recover_password(data) ⇒ Object
Recover Password.
Send a email that contains a token to a contact. That token will be used in reset_password to establish a new password.
Parameters
- data
-
(Hash) – It’s a data key where will be hosted the destination email.
Example
data = { "email": "email@example.com" }
@mints_contact.recover_password(data)
76 77 78 |
# File 'lib/contact.rb', line 76 def recover_password(data) return @client.raw("post", "/contacts/recover-password", nil, data_transform(data)) end |
permalink #register(data) ⇒ Object
Register.
Register a contact.
Parameters
- data
-
(Hash) – It’s the register data.
Example
data = {
"email": "email@example.com",
"given_name": "Given Name",
"last_name": "Last Name",
"password": "password"
}
@mints_contact.register(data);
40 41 42 |
# File 'lib/contact.rb', line 40 def register(data) return @client.raw("post", "/contacts/register", nil, data_transform(data)) end |
permalink #reset_password(data) ⇒ Object
Reset Password.
Reset password using a token. The token is obtained by recover_password method.
Parameters
- data
-
(Hash) – It’s a set of data which contains all the information to reset a contact password.
Example
data = {
"email": "email@example.com",
"password": "password",
"password_confirmation": "password",
"token": "644aa3aa0831d782cc42e42b11aedea9a2234389af4f429a8d96651295ecfa09"
}
@mints_contact.reset_password(data)
95 96 97 |
# File 'lib/contact.rb', line 95 def reset_password(data) return @client.raw("post", "/contacts/reset-password", nil, data_transform(data)) end |
permalink #scheduled_appointments(data) ⇒ Object
Scheduled Appointments.
Get a collection of appointments filtering by object_type, object_id and dates range.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"object_model": "products",
"object_id": 2,
"start": "2021-11-25T14:15:00+00:00",
"end": "2022-01-01T13:00:00+00:00"
}
@data = @mints_contact.scheduled_appointments(data)
442 443 444 |
# File 'lib/contact.rb', line 442 def scheduled_appointments(data) return @client.raw("post", "/contacts/appointments/scheduled-appointments", nil, data_transform(data)) end |
permalink #send_magic_link(email, template_slug, redirectUrl = '', lifeTime = 1440, maxVisits = nil) ⇒ Object
Send Magic Link.
Send magic link to contact by email. That magic link will be used in magic_link_login method.
Parameters
-
(String) – Contact’s email.
- template_slug
-
(String) – Email template’s slug to be used in the email.
- redirectUrl
-
(String) – Url to be redirected in the implemented page.
- lifeTime
-
(Integer) – Maximum time of use in minutes.
- maxVisits
-
(Integer) – The maximum number of uses of a token.
First Example
@mints_contact.send_magic_link("email@example.com", "template_slug")
Second Example
@mints_contact.send_magic_link("email@example.com", "template_slug", "", 1440, 3)
141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/contact.rb', line 141 def send_magic_link(email, template_slug, redirectUrl = '', lifeTime = 1440, maxVisits = nil) data = { email: email, lifeTime: lifeTime, maxVisits: maxVisits, redirectUrl: redirectUrl, templateId: template_slug } response = @client.raw("post", "/contacts/magic-link", nil, { data: data }.to_json, '/api/v1') return response end |
permalink #status ⇒ Object
Status.
Get contact logged status.
Example
@data = @mints_contact.status
181 182 183 |
# File 'lib/contact.rb', line 181 def status return @client.raw("get", "/status", nil, nil, @contact_v1_url) end |
permalink #sync_follower(data) ⇒ Object
Sync Follower.
Sync a follower from an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"follower_ids": 1
}
@data = @mints_contact.sync_follower(data)
544 545 546 |
# File 'lib/contact.rb', line 544 def sync_follower(data) return @client.raw("post", "/contacts/appointments/sync-follower", nil, data_transform(data)) end |
permalink #sync_invitee(data) ⇒ Object
Sync Invitee.
Sync an invitee from an appointment.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"appointment_id": 1,
"invitee_ids": 1
}
@data = @mints_contact.sync_invitee(data)
527 528 529 |
# File 'lib/contact.rb', line 527 def sync_invitee(data) return @client.raw("post", "/contacts/appointments/sync-invitee", nil, data_transform(data)) end |
permalink #update(data) ⇒ Object
Update.
Update logged contact attributes.
Parameters
- data
-
(Hash) – It’s the data to update with a session active.
Example
data = {
"given_name": "Given Name",
"last_name": "Last Name"
}
@data = @mints_contact.update(data)
198 199 200 |
# File 'lib/contact.rb', line 198 def update(data) return @client.raw("put", "/update", nil, data_transform(data), @contact_v1_url) end |
permalink #update_appointment(id, data) ⇒ Object
Update Appointment.
Update an appointment info.
Parameters
- id
-
(Integer) – Appointment id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"object_id": 2
}
@data = @mints_contact.update_appointment(1, data)
423 424 425 |
# File 'lib/contact.rb', line 423 def update_appointment(id, data) return @client.raw("put", "/contacts/appointments/#{id}", nil, data_transform(data)) end |
permalink #update_conversation(id, data) ⇒ Object
Update Conversation.
Update a location template info.
Parameters
- id
-
(Integer) – Conversation id.
- data
-
(Hash) – Data to be submited.
FIXME: This method doesn’t locate conversation id to be updated.
279 280 281 |
# File 'lib/contact.rb', line 279 def update_conversation(id, data) return @client.raw("put", "/content/conversations/#{id}", nil, data_transform(data), @contact_v1_url) end |
permalink #update_conversation_status(id, data) ⇒ Object
Update Conversation Status.
Update a conversation status.
Parameters
- id
-
(Integer) – Conversation id.
- data
-
(Hash) – Data to be submited.
FIXME: This method doesn’t locate conversation id to be updated.
291 292 293 |
# File 'lib/contact.rb', line 291 def update_conversation_status(id, data) return @client.raw("put", "/content/conversations/#{id}/status", nil, data_transform(data), @contact_v1_url) end |
permalink #update_order(id, data) ⇒ Object
Update Order.
Update an order info.
Parameters
- id
-
(Integer) – Order Id
- data
-
(Hash) – Data to be submited.
FIXME: This method doesnt update an order.
620 621 622 |
# File 'lib/contact.rb', line 620 def update_order(id, data) return @client.raw("put", "/ecommerce/orders/#{id}", nil, data_transform(data), @contact_v1_url) end |
permalink #update_order_item_from_order_item_group(orderItemId, groupId, data) ⇒ Object
TODO: No tested
Update Order Item From Order Item Group.
Update an order item data from an order item group.
Parameters
- orderItemId
-
(Integer) – Order item id.
- groupId
-
(Integer) – Order items group id.
644 645 646 |
# File 'lib/contact.rb', line 644 def update_order_item_from_order_item_group(orderItemId, groupId, data) return @client.raw("put", "/ecommerce/order-items/update/#{orderItemId}/order-items-groups/#{groupId}", nil, data_transform(data), @contact_v1_url) end |
permalink #update_order_item_group(id, data) ⇒ Object
Update Order Item Group.
Update an order item group info if you are related to that order.
Parameters
- id
-
(Integer) – Order Item Group Id.
- data
-
(Hash) – Data to be submited.
First Example
data = {
"name": "New Order Item Group Name Updated"
}
@data = @mints_contact.update_order_item_group(130, data)
773 774 775 |
# File 'lib/contact.rb', line 773 def update_order_item_group(id, data) return @client.raw("put", "/ecommerce/order-items-groups/#{id}", nil, data_transform(data), @contact_v1_url) end |