Redirect
The Redirect verb is used to redirect the current XML execution to another URL.
caution
<Redirect>
should be the last verb in the BXML response, as any verbs after <Redirect>
will not be executed.
Text Content
There is no text content available to be set for the <Redirect>
verb.
Attributes
Attribute | Description |
---|---|
redirectUrl | (required) URL to request new BXML from. A Redirect event will be sent to this endpoint. May be a relative URL. |
redirectMethod | (optional) The HTTP method to use for the request to redirectUrl . GET or POST. Default Value is POST. |
redirectFallbackUrl | (optional) A fallback url which, if provided, will be used to retry the Redirect callback delivery in case redirectUrl fails to respond. |
redirectFallbackMethod | (optional) The HTTP method to use to deliver the Redirect callback to redirectFallbackUrl . GET or POST. Default value is POST. |
username | (optional) The username to send in the HTTP request to redirectUrl . |
password | (optional) The password to send in the HTTP request to redirectUrl . |
fallbackUsername | (optional) The username to send in the HTTP request to redirectFallbackUrl . |
fallbackPassword | (optional) The password to send in the HTTP request to redirectFallbackUrl . |
tag | (optional) A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or <Tag> verb, or cleared.May be cleared by setting tag="" Max length 256 characters. |
Webhooks Received
Webhooks | Can reply with more BXML |
---|---|
Redirect | Yes |
Examples
Redirect a Call to New BXML Instructions
- XML
- Java
- C#
- Ruby
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Redirect redirectUrl="http://flow.url/newFlow"/>
<!--Username and Password are not required, but are included to demonstrate adding multiple attributes to the redirect tag-->
</Response>
Redirect redirect = new Redirect().builder()
.redirectUrl("https://flow.url/newFlow")
.build();
Response response = new Response()
.with(redirect);
System.out.println(response.toBXML());
Redirect redirect = new Redirect
{
RedirectUrl = "http://flow.url/newFlow"
};
Response response = new Response();
response.Add(redirect);
Console.WriteLine(response.ToBXML());
redirect = Bandwidth::Bxml::Redirect.new({ redirect_url: 'http://flow.url/newFlow' })
response = Bandwidth::Bxml::Response.new([redirect])
p response.to_bxml
const redirect = new Bxml.Redirect({
redirectUrl: 'https://flow.url/newFlow'
});
const response = new Bxml.Response(redirect);
console.log(response.toBxml());
redirect = Redirect(
redirect_url="http://flow.url/newFlow"
)
response = Response()
response.add_verb(redirect)
print(response.to_bxml())
$redirect = new BandwidthLib\Voice\Bxml\Redirect();
$redirect->redirectUrl("https://flow.url/newFlow");
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($redirect);
echo $response->toBxml();