When using online service with Postback URL or DSU enabled, the scanning device needs Internet connectivity to validate against the online database.
However, you can allow the app-user to record scans automatically without interruption if connectivity is lost. To do that, on the Advanced step you would need to enable “Auto-Sync” and also under “Auto-Next Scan” select the option “Always. (Save if error.) If the connection fails, log a record on-device and continue.”
Using this feature, the scan isn’t validated but a record is saved on the device and auto-uploaded to the designated Postback or DSU URL when connectivity is restored.
Until API 2.0 is released, there isn’t an option to add a custom HTTP header to posts. Here are your current options:
You can find the IP addresses for whitelisting on your Account page under the API tab.
You need to escape what goes inside the text node. For example, you can’t just put “html” with brackets (general escaping examples here).
For Postback URL, scans are posted in Eastern Time. The scan record will also include the device timestamp as converted to UTC under the “scanned_at_utc” variable. For DSU, scans include both a “scanned_at_utc” variable and a “device_timestamp” variable. The device timestamp variable is saved as the device’s time zone rather than being converted to UTC.
When using Postback URL, you can define what your server receives based on an Export Template. When using DSU, the variables are not able to be structured with a template.
If you want to see what is posted to your server, you can put an ‘echo’ at the beginning of your postback. Then, the post received will be emailed to you. Also, if placed at the beginning of your script, you should still get the email even if there’s a problem with your script.
Though setting up an echo will vary based on your programming language, here’s one example:
mail(“email@example.com”, “Echo POSTBACK”, print_r($_POST,true));
WebHook.Site is an alternative to Echo Postback when using Postback on the Advanced step in Receiver-Only mode. This website will show the form data as well as the raw data. Additionally, it works with Question data.
Treat answers not as a plain array but as an associative array or a dictionary where the keys are question IDs.
A normal index array is this:
answers = answer X
answers = answer Y
answers[n] = answer Z
We are not posting it that way. We are posting based on the questions created and assigned to the service. Thus, given assigned questions with question id #1111 and #2222 to your service, when someone scans and submits the post will be:
answers = answer for question id 1111
answers = answer for question id 2222
Important: First, you need to consider when you are submitting answers. For instance, if you have pre-submit questions, the answers will come with the one post. Moreover, if you have post-submit questions, you will receive two posts with the same ID for you to know the relation.