Update an Application
Use this endpoint for the Applications method to modify the properties of an application.
Parameters
Parameter | |
---|---|
FriendlyName Required | The description, up to 64 characters long, of the application. |
MessageStatusCallback Optional | If a message's ApplicationSid is set to this application's Sid , when a message receives a status change, SignalWire will send a POST request to this URL with the message's details. |
SmsFallbackMethod Optional | Whether the request to SmsFallbackUrl is a GET or a POST . Default is POST . |
SmsFallbackUrl Optional | The URL SignalWire will request if errors occur when fetching the SmsUrl . |
SmsMethod Optional | Whether the request to SmsUrl is a GET or a POST . Default is POST . |
SmsStatusCallback Optional | If a message's ApplicationSid is set to this application's Sid , when a message receives a status change, SignalWire will send a POST request to this URL with the message's details. |
SmsUrl Optional | The URL to request when an SMS is received. |
StatusCallback Optional | The URL to pass call status updates to the application. |
StatusCallbackMethod Optional | Whether the request to the StatusCallback URL is a GET or a POST . Default is POST . |
VoiceFallbackMethod Optional | Whether the request to VoiceFallbackUrl is a GET or a POST . Default is POST . |
VoiceFallbackUrl Optional | The URL SignalWire will request if errors occur when fetching the Url . |
VoiceMethod Optional | Whether the request to VoiceUrl is a GET or POST . Default is POST . |
VoiceUrl Optional | The URL to request when a phone number receives a call or fax. |
Example Request: Update an Application
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json \
-X POST \
--data-urlencode "SmsUrl=http://your-application.com/docs/sms.xml" \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.applications('Sid')
.update({smsUrl: 'http://your-application.com/docs/sms.xml'})
.then(application => console.log(application.friendlyName))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var application = ApplicationResource.Update(
smsUrl: new Uri("http://your-application.com/docs/sms.xml"),
pathSid: "Sid"
);
Console.WriteLine(application.FriendlyName);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
application = client.applications('Sid') \
.update(sms_url='http://your-application.com/docs/sms.xml')
print(application.friendly_name)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
application = @client.applications('Sid')
.update(
sms_url: 'http://your-application.com/docs/sms.xml'
)
puts application.friendly_name
Responses
200 OK
{
"account_sid": "b3877c40-da60-4998-90ad-b792e98472af",
"api_version": "2010-04-01",
"date_created": "Sun, 16 Sept 2018 10:00:00 +0000",
"date_updated": "Mon, 17 Sept 2018 20:00:00 +0000",
"friendly_name": "Application1",
"message_status_callback": "http://www.example.com/sms-status-callback",
"sid": "b3877c40-da60-4998-90ad-b792e98472af",
"sms_fallback_method": "GET",
"sms_fallback_url": "http://www.example.com/sms-fallback",
"sms_method": "GET",
"sms_status_callback": "http://www.example.com/sms-status-callback",
"sms_url": "http://your-application.com/docs/sms.xml",
"status_callback": "http://example.com",
"status_callback_method": "GET",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Applications/b3877c40-da60-4998-90ad-b792e98472af.json",
"voice_caller_id_lookup": false,
"voice_fallback_method": "GET",
"voice_fallback_url": "http://www.example.com/voice-callback",
"voice_method": "GET",
"voice_url": "http://example.com"
}
Example Request: Update an Application's VoiceUrl
Update the URL that SignalWire will request when a call to your account is received.
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json \
-X POST \
--data-urlencode "VoiceUrl=http://your-application.com/docs/voice.xml"
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.applications('Sid')
.update({
voiceUrl: 'http://your-application.com/docs/voice.xml'
})
.then(application => console.log(application.friendlyName))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var application = ApplicationResource.Update(
voiceUrl: new Uri("http://your-application.com/docs/voice.xml"),
pathSid: "Sid"
);
Console.WriteLine(application.FriendlyName);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
application = client.applications('Sid') \
.update(
voice_url='http://your-application.com/docs/voice.xml'
)
print(application.friendly_name)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
application = @client.applications('Sid')
.update(
voice_url: 'http://your-application.com/docs/voice.xml'
)
puts application.friendly_name