Using the Advanced HTTP Application

back to developer home

Overview

The Advanced HTTP Application provides a way to call web services directly from the touchatag Application Correlation Service (ACS), instead of from the end user’s browser. For example, it could be used to log events to a web server, such for tracking when a mobile worker visits a specific station.

Compare with Weblink App

There is a significant difference between the Advanced HTTP Application and touchatag’s popular Web Link Application.

The Web Link Application calls a URL by opening the end user’s browser, using the following workflow:

  1. The end user touches a tag to his or her reader, which calls on the ACS to correlate a tag action.
  2. The ACS determines that the tag is associated to a Web Link Application, and sends back the URL to the end user's system.
  3. The end user's browser opens the URL sent by the ACS.

The Advanced HTTP Application calls a URL directly from the ACS, without opening the end user’s browser:

  1. The end user touches a tag to his or her reader, which calls on the ACS to correlate a tag action.
  2. The ACS determines that the tag is associated to an Advanced HTTP Application, and calls the URL according to how the Advanced HTTP Application has been configured.

Benefits & Limitations

The Advanced HTTP Application is better suited for security uses than the standard Web Link Application. Because the URL call is performed by the ACS rather than the end user's system, the tag holder does not know what action is being performed by the touchatag system. The standard Web Link Application opens the target site in a browser, so the end user can easily copy the URL and use it from any other system.

One limitation to the Advanced HTTP Application is that it provides little client-side feedback to the end user, such as opening a system tray message or web page to confirm the tag transaction. However, you can use touchatag to create more complex feedback scenarios such as these using touchatag developer tools and interfaces. (See Touchatag Developer Network, for more information.)

Implementation

As the name implies, the Advanced HTTP Application is intended for advanced users who are more familiar with using Internet services & protocols.

Implementation Video

This video presents an overview of how the Advanced HTTP Application works, and shows a simple implementation for using the POST method.

Advanced HTTP Application How-to (on Vimeo).

Supported HTTP Methods

The Advanced HTTP Application can assign the ACS to call any Internet-accessible URL, using either the HTTP GET or POST method. The template also allows you to provide any parameters that are required in the URL.

configurator screenshot

Implementation Steps

  1. Enter a name and description for your Application configuration.
  2. Select the HTTP Method required by target the web service.
  3. Enter the URL of the target the web service.
  4. Enter whatever key/value Parameters are required by target the web service.
    • You do not need to HTML-encode special characters (such as spaces) in the parameters.
    • Key/value pairs left blank will be removed from the application after each re-configuration.
  5. Click use this app to complete Step 1 of the configurator.

Relationship to the ACS Block System

The Touchatag Technical Whitepaper introduces you to the ACS Block System. To handle Advanced HTTP Applications, the ACS uses a block called the ACS HTTP Client block. The touchatag API allows 3rd party developers to use the ACS HTTP Client block in their own custom applications. (See ACS Block System, for more information.)

Your Suggestions

If you have an idea for how we can improve this application, please let us know by leaving a comment below.

 

Comments

advanced http issues

Hi,

I've tried to recreate a similar app that's demonstated on the video. I can't get it to work though.

I've set the following:
URL: mydomain.com/touchatag.php
param 1: tag
value 1: touchatag.tag.hash;
param 2: user
value 2: myname

I get the "Successful" message but my php script doesn't insert anything in the DB.

I've got a condition:

if(isset($_REQUEST['user'])){
//insert into database
}

so the "user" parameter/value isn't being passed and as far as I can tell it should be.

As far as I can tell I've done everything correctly, something is obviously not right though. Any ideas?

Thanks in advance.

CC

Can we use the ruby app you made to try stuff out?

I wouldn't want to steal off your work, but if its not a big app, it might be fun to try it out, for those of us tinkerers out there.

Special Value

Are there more special values that I can use?
The only I see here is: &touchatag.tag.hash; and &touchatag.reader.hash;

Thanks

Accessing a PHP script on localhost

Suppose I am behind a NAT (i.e. the client does not have a public IP address) and I want to use this method to access a PHP script located on the client (i.e. localhost, 127.0.0.1). I cannot use a URL of the form "http://127.0.0.1/script.php" as the ACS will attempt to access itself.

Is there another method to accomplish this? In other words; I would like a version of this app that instructs the *client* to open the URL, similar to "Web Link" but without a browser window popping up whenever the app is triggered, with the possibility to pass POST/GET parameters and that also understands the special values &touchatag.tag.hash; and &touchatag.reader.hash;

Accessing http://127.0.0.1/ outside the browser

I'm not sure that there is an easy way to accomplish this today.

One way to open URLs outside of the browser is to use a program like cURL (http://curl.haxx.se/), to save the necessary cURL commands in a batch file and to use the Web Link application and the file:/// notation to launch the batch file. However, this won't allow you to use the special values &touchatag.tag.hash; and reader.hash;


Another way I can think of is by using the advanced HTTP functionality in the touchatag server and by manually creating a static port mapping in your NAT. Certain home gateways allow you to create a port mapping in the NAT such that http connections directed towards your gateway on a certain TCP port are forwarded to an internal IP address (e.g. 192.168.0.2) and a certain internal port. So you wouldn't use 127.0.0.1 in the URL in the advanced HTTP app, but the public IP address of your home gateway. Whether this will work or not will depend on your gateway.


The easiest way to accomplish what you want to do would be for touchatag to release a "run command" application or an "open URL directly" application. I don't have a release date for these features however.

How can I make a simple application with this?

Hello,

I'm a master student in multimedia design and wanted to use this Advanced HTTP application for my thesis. I'm not really a developer, so I have some questions about using it. The functionality of the application I want to make, is kind of the same as in the movie example. I want to add some simple data (like an ID, a name and a date/time) to a XML, but I don't know which components I need. Do I only need to make a XML file with the structure or do I also need a web service? I actually know little about how to set up a web service, so can someone tell me what I need to make this relatively simple application? Or can someone direct me to a website with some info about which kind of web service (or other components) I need and how I can make it?

Thanks in advance.

Creating a Simple Application

ploempje:
There are many ways to go about doing what you describe, and it would be difficult to explain the complete process in depth. Essentially, you just need an web service that will accept an http POST or GET method.

The demo that I show in the video was created using www.herokugarden.com, a free Ruby-on-Rails hosting site. Rails is particularly quick to use for doing this (but not necessarily quick to learn). To make the demo that I showed, I used RoR's scaffolding system, which built the app for me after I fed it a few commands. If you know someone who knows Rails, buy them a six-pack and call in a 20-minute favor. :)

--Ted

--Ted

Ted Haeger

Touchatag Developer Network

ted@touchatag.com

Weblink App and Advanced HTTP Application combination

Hello,

We've to implement the following scenario using Touchatag an IMM ALU products:

1- a social care worker enters an end user home and touches the existing tag at this home.
2- this tag touch has to force the sending of a post to the Teleassistance platform so as to store the msisdn of the social care, the tag id of the end user and the timestamp. It will allow the social care to mark the start of his job.
3- after having touch the tag, the social care worker has to view an url:
3.1- an ok url if the Teleassistance platform answered ok to the post
3.2- an nok url if the Teleassistance platform answered nok to the post (bad id, msisdn not provisioned...)
4- when the social care worker leaves the end user home, the process 1-2-3 has to be repeated so as to store the msisdn of the social care, the tag id of the end user and the timestamp. Therefore, it will allow the social care to mark the end of his job and consequently be paid by the teleassistance service provider.

On this scenario, we strongly need both applications: Weblink App and Advanced HTTP Application combination are needed.
Could you indicate us how to combine them or how to implement our scenario?

Thanks a lot.

We can do that!

Hey Teleassistance20:
Yesterday's new feature release gives us the tools to do that. Instead of using the Advanced HTTP Client App, you'll need to assemble a custom application to do so. I can help you do so.
Please get in touch with me by email as ted (touchatag.com).
--Ted

--Ted

Ted Haeger

Touchatag Developer Network

ted@touchatag.com

How can I make a simple application with this?

*see my other comment*