Module: ChatWork::IncomingRequest

Extended by:
EntityMethods
Defined in:
lib/chatwork/incoming_request.rb

Class Method Summary collapse

Class Method Details

.destroy(request_id:) ⇒ Object Also known as: decline

You can decline a contact approval request you received



62
63
64
# File 'lib/chatwork/incoming_request.rb', line 62

def self.destroy(request_id:)
  _delete("/incoming_requests/#{request_id}")
end

.getArray<Hashie::Mash>

You can get the list of contact approval request you received

(*This method returns up to 100 entries. We are planning to implement pagination to support larger number of data retrieval)

Examples:

response format

[
  {
    "request_id": 123,
    "account_id": 363,
    "message": "hogehoge",
    "name": "John Smith",
    "chatwork_id": "tarochatworkid",
    "organization_id": 101,
    "organization_name": "Hello Company",
    "department": "Marketing",
    "avatar_image_url": "https://example.com/abc.png"
  }
]

Returns:

  • (Array<Hashie::Mash>)

See Also:



28
29
30
# File 'lib/chatwork/incoming_request.rb', line 28

def self.get
  _get("/incoming_requests")
end

.update(request_id:) ⇒ Hashie::Mash Also known as: approve

You can approve a contact approval request you received

Examples:

response format

{
  "account_id": 363,
  "room_id": 1234,
  "name": "John Smith",
  "chatwork_id": "tarochatworkid",
  "organization_id": 101,
  "organization_name": "Hello Company",
  "department": "Marketing",
  "avatar_image_url": "https://example.com/abc.png"
}

Parameters:

  • request_id (Integer)

Returns:

  • (Hashie::Mash)

See Also:



52
53
54
# File 'lib/chatwork/incoming_request.rb', line 52

def self.update(request_id:)
  _put("/incoming_requests/#{request_id}")
end