redirect Action

Redirect to a new web page.


The redirect properties are:

PropertyRequired/OptionalDefaultDescription
next pagerequired-A web page request object that defines the next page to be requested.

web page request defines how a specific web page is requested:

PropertyRequired/OptionalDefaultDescription
urlrequired-The address of the web page to request.
methodoptionalPOSTOne of "GET" or "POST". The HTTP request method to use when requesting the url.

  • Examples:

    • Redirect to an alternative page using the default method:

      "redirect" :
      {
          "next_page" : 
          {
              "url" : "my_alternative_page"
          }
      }
      
    • Redirect to an alternative page using the GET method:

      "redirect" :
      {
          "next_page" : 
          {
              "url" : "my_alternative_page",
              "method" : "GET"
          }
      }
      
  • API Reference:

    class Redirect : TelephonyAction

    Represents a redirect action.

    Constructors:

    Redirect(WebPageRequest nextPage);
    
    class WebPageRequest

    Represents a request to a web page.

    Constructors:

    WebPageRequest(String url);
    WebPageRequest(String url, String method);
    

    Members:

    String Method;
    

    Examples:

    • Redirect to an alternative page using the default method:

      actions.Add(new Redirect(new WebPageRequest("MyAlternativePage.aspx")));
      
    • Redirect to an alternative page using the GET method:

      actions.Add(new Redirect(new WebPageRequest("MyAlternativePage.aspx", "GET")));
      
  • API Reference:

    Class Redirect Inherits TelephonyAction

    Represents a redirect action.

    Constructors:

    New(nextPage As RestAPIWrapper.WebPageRequest)
    
    Class WebPageRequest

    Represents a request to a web page.

    Constructors:

    New(url As String)
    New(url As String, method As String)
    

    Members:

    Method As String
    

    Examples:

    • Redirect to an alternative page using the default method:

      actions.Add(New Redirect(New WebPageRequest("MyAlternativePage.aspx")))
      
    • Redirect to an alternative page using the GET method:

      actions.Add(New Redirect(New WebPageRequest("MyAlternativePage.aspx", "GET")))
      
  • API Reference:

    class Redirect extends TelephonyAction

    Represents a redirect action.

    Constructors:

    Redirect(WebPageRequest nextPage);
    
    class WebPageRequest

    Represents a request to a web page.

    Constructors:

    WebPageRequest(String url);
    WebPageRequest(String url, String method);
    

    Members:

    setMethod(String method);
    

    Examples:

    • Redirect to an alternative page using the default method:

      actions.add(new Redirect(new WebPageRequest("MyAlternativePage")));
      
    • Redirect to an alternative page using the GET method:

      actions.add(new Redirect(new WebPageRequest("MyAlternativePage", "GET")));
      
  • API Reference:

    class Redirect

    Represents a redirect action.

    Constructors:

    Redirect(next_page) # next_page is a WebPage object. See below.
    
    class WebPage

    Represents a web page.

    Constructors:

    WebPage(url, method='POST')
    

    Examples:

    • Redirect to an alternative page:

      from aculab.telephony_rest_api import Actions, Redirect, WebPage
      
      my_actions = Actions(token='Usage example: Redirect')
      my_actions.add(Redirect(next_page=WebPage(url='my_alternative_page')))
      
      response_body = my_actions.get_json()
      
    • Redirect to an alternative page using the GET method:

      from aculab.telephony_rest_api import Actions, Redirect, WebPage
      
      my_actions = Actions(token='Usage example: Redirect')
      my_actions.add(Redirect(next_page=WebPage(url='my_alternative_page', method='GET')))
      
      response_body = my_actions.get_json()
      
  • API Reference:

    The Redirect class

    Introduction

    Represents a redirect action.

    Class synopsis

    class Redirect extends ActionBase {
    
        /* methods */
        public __construct(string $next_page, string $method = null)
    }
    

    Examples:

    • Redirect to an alternative page using the default method:

      $actions->add(new Aculab\TelephonyRestAPI\Redirect('alternativePage'));
      
    • Redirect to an alternative page using the GET method:

      $actions->add(new Aculab\TelephonyRestAPI\Redirect('alternativePage', 'GET'));