Method: Twilio::REST::Api::V2010::AccountContext::CallContext::UserDefinedMessageList#create

Defined in:
lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb

#create(content: nil, idempotency_key: :unset) ⇒ UserDefinedMessageInstance

Create the UserDefinedMessageInstance

Parameters:

  • content (String) (defaults to: nil)

    The User Defined Message in the form of URL-encoded JSON string.

  • idempotency_key (String) (defaults to: :unset)

    A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb', line 42

def create(
    content: nil, 
    idempotency_key: :unset
)

    data = Twilio::Values.of({
        'Content' => content,
        'IdempotencyKey' => idempotency_key,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    UserDefinedMessageInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        call_sid: @solution[:call_sid],
    )
end