Follow

HTTP Get (system browser)

HTTP Get (system browser)
 
When triggered, this will open the system's default web browser and navigate to the specified path. The parameters you specify will be added to the query string. A query string is the portion of a URL following the path. It is separated from the path by a question mark (?) and consists of a series of matched keys and values.
 
http://www.ximasoftware.com/chronicall?foo=Hello&bar=World
 
In the above example, "foo=Hello&bar=World" is the query string.
 
 
Above is an example of how to create a request to http://www.ximasoftware.com/chronicall?foo=Hello&bar=World.
 
Using the Dashboards API, you can pass many different types of parameters into the query string, including a caller ID, the current time, an agent name, and more. A website can then access that information and use it to look up a contact file, fill in text fields and forms, or perform an automatic task.
 
To pass Chronicall-specific data into your browser, simply select a value from the Value drop-down menu.
 
 
Now, when an inbound call rings for Amy Barton(211) from the phone number 801-713-2800, the Dashboards API will open a web browser and navigate to the following URL.
 
http://www.ximasoftware.com/chronicall?foo=8017132800&bar=Amy+Barton(211)
 
When adding a value, you can choose from any option available in the Value list. To add a key that does not have a matching value, simply select "Empty Value":
 
 
The above will result in a request like this:
 
http://www.ximasoftware.com/chronicall?foo=8017132800&bar=Amy+Barton(211)&test
 
You also have the option of leaving the key blank:
 
 
Now, when someone calls the Sales(400) group and rings Amy Barton(211) from 801-713-2800, this will produce the following request.
 
http://www.ximasoftware.com/chronicall?foo=8017132800&bar=Amy+Barton(211)&test&Sales(400)
 
 
PHP Example
 
<?php
/**
 * The following script demonstrates how to parse parameters passed in through the url
 *
 * Visit this page with the following query string: ?foo=8017132800&bar=Amy+Barton(211)&test&Sales(400)
 * Example: http://www.ximasoftware.com/chronicall?foo=8017132800&bar=Amy+Barton(211)&test&Sales(400)
 */
 
 ?>
 
 <html>
 <head>
 <title>PHP Query Parameter Example</title>
 </head>
 <body>
 
 <?php //Look for the 'foo' parameter ?>
 <?php $foo = $_GET['foo']; ?>
 <p>The parameter foo equals: <?php print $foo; ?> </p>
 
 <?php //Look for and decode the 'bar' parameter ?>
 <?php $bar = urldecode($_GET['bar']); ?>
 <p>The decoded parameter bar equals: <?php print $bar; ?></p>

 <?php //Now, loop over every query parameter and print it to screen ?>
 <p>This is every available url parameter</p>
 <ul>
 <?php foreach ($_GET as $key => $value): ?>
 <li><?php print $key; ?>: <?php print $value; ?></li>
 <?php endforeach; ?>
 </ul> 
 
 </body>
</html>
 
Java Example
 
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLDecoder;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ExampleServet extends HttpServlet
{
 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
 {
 PrintWriter out = resp.getWriter();
 
 //Look for the "foo" parameter
 String foo = req.getParameter("foo");
 out.println("<p>The parameter foo equals: " + foo + "</p>");
 
 //Look for and decode the "bar" parameter
 String bar = URLDecoder.decode(req.getParameter("bar"), "UTF-8");
 out.println("<p>The decoded parameter bar equals: " + bar + "</p>");
 
 //Now loop over every query parameter and print it to the screen
 out.println("<p>This is every available url parameter</p>");
 out.println("<ul>");
 
 Enumeration<String> parameterNames = req.getParameterNames();
 while (parameterNames.hasMoreElements())
 {
 String key = parameterNames.nextElement();
 String value = req.getParameter(key);
 out.println("<li>" + key + ":" + value + "</li>");
 }
 
 out.println("<ul>");
 }
}
 
 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk