Request Demo

API: DemonstratorGauge Event Upload

Blog by Adam Dorrell
February 14, 2018

API Documentation – DemonstatorGauge Event Upload 8 December 2009 - v0.2

What this API does:

SUMMARY: Using a cURL command in a PHP file hosted on your server, you can upload multiple event information into DemonstratorGauge from a prepared XML file also hosted on your server.


In the file clientCanon.php a cURL command uploads the XML file eventsCanon.xml to the DemonstratorGauge server.

The XML file can contain multiple events. Each event contains information on user, event, date etc. Up to 4 photos can be added. Any number of products sold or featured can be added.

Note: You must be able to enter correct IDs for the following:

  • Demonstrator
  • Venue
  • Product

These can be retrieved from DemonstratorGauge as a user or using the API DemonstratorGauge Data Download

At this stage we do not have an API to add users or venues. These must be done manually in the system. Canon maintain the list of products manually – requests for products to be added must go to Canon.

Using the API

To use the API, upload clientCanon.php and eventsCanon.xml to your server. You will need a valid key. Requirements: PHP 5.

Insert the required information in the XML file. Then run client.php to call and upload the XML file.

On a successful upload, the system will return “X records  uploaded”


Successful upload: Upon completion, the page will display two download links:

DGResultList.csv -- Displays the successfully uploaded records today
DGErrorList.csv -- Displays the error(s) that occurred.

Typical result:

[caption id="attachment_1402" align="alignnone" width="400" caption="Example output from API "]Example output from API[/caption]

Validation - contents of successful report:

[caption id="attachment_1403" align="alignnone" width="400" caption="DGresultlist.csv: Successful result returning new Event IDs, and confirming Demonstrator and Venue ID"]Successful result returning new Event IDs, and confirming Demonstrator and Venue ID[/caption]

Error messages:

error1: Key Invalid
error2: API key needs renewing - out of date - please contact to reset
error3: Duplicate record(s) detected
error4: Product ID(s) is unrecognizable
error5: Venue ID(s) is unrecognizable
error6: record(s) has  Invalid Event Date
error7: record(s) has invalid PersonID

Error Notes:

  • error3: Duplicate record detected: If demonstratorID AND venueID AND eventDate match a previously uploaded event (for 1 event)
  • error5: VenueID will be invalid if system can NOT find VenueID in the database, or system can find VenueID in the database but Venue address dows not belong to Agency's country.
  • error6: Invalid Event Date: Date of event is in the future  ( EventDate > today) or incorrectly formatted

Example of Error result:

[caption id="attachment_1404" align="alignnone" width="400" caption="DGErrorList.csv: Shows details of any uploading errors to help debugging"]DGErrorList.csv: Shows details of any uploading errors to help debugging[/caption]

XML and contents:

Event details


<EventActivity> </EventActivity>

Place all event details inside these tags. Allows you to upload multiple events at one time.



Integer: The ID of the Demonstrator e.g. ‘10112’

(Adam J Dorrell) Source: Person Table. Agents can add themselves.



Integer: ID of venue. E.g. ‘8290’ (Dixons Travel Heathrow Terminal 5) Source: Venue Table. Agents can add Venues.



Two letter code: eg ‘DE’, ‘UK’



Focus of the event. Text. Choose ONE from


Compact Cameras

Compact Photo Printers

Inkjet PrintersMF

Inkjet PrintersSF

Digital SLR





Inkjet Consumables


Digital SLR



Date of event in YYYY-MM-DD



Decimal: Number of hours spent on site. Eg ‘3.5’ (3 hours 30 minutes)



Integer: Number of contacts made on site, eg ‘34’



Free text description of what happened on site. Example: ‘Super Promo. Super Angebote: Cashback und 500D für 899, mit 18-200mm für 1319.-‘

Limit 1024 characters



URL. The system will retrieve the photo from a remote system. Example ‘’

Please no larger than 4Mb.

We resize to 1600x1600 (max) so higher resolution not needed.



Text describing photo: Example ‘Canon Booklet Info Display’

Limit 255 characters

<Photo2URL> <Photo3URL> <Photo4URL>


As Photo1. You can add up to 4 photos.

<Photo2Caption> <Photo3Caption> <Photo4Caption>


As <Photo1Caption>. You can add up to 4 captions.



Text. You can add your own event reference. Eg “Agent444, Event56”. 40chars.

Product section - you can add up to 100 product items focused per event


<ProductDetails> </ProductDetails>

You can add Products focused in this section



Integer. Unique iD of product. Eg ‘47’ (Selphy ES1). Source: Product Table. This table maintained by Canon.



Integer: Number of units sold of this product. Eg ‘23’



String. Was this product “focused” on the day? Example ‘Yes’. Choose from ‘Yes’ or NULL

Data: XML formatting Example

<EventActivity   xmlns:xsi="">
<DemonstratorID   xsi:type="xsd:integer">9</DemonstratorID>
<VenueID   xsi:type="xsd:integer" >120</VenueID>
<EventDate   xsi:type="xsd:string" >2009-10-01</EventDate>
<NumberOfHours   xsi:type="xsd:decimal" >3.5</NumberOfHours>
<NumberOfContacts   xsi:type="xsd:integer" >5</NumberOfContacts>
<Comments   xsi:type="xsd:string" >The event was very busy</Comments>
<SingleProductGroup  xsi:type="xsd:string">Video</SingleProductGroup>
<Photo1URL xsi:type="xsd:string" >images/1072108-2-vermont-autumn.jpg</Photo1URL>
<Photo1Caption   xsi:type="xsd:string" >Autumn</Photo1Caption>
<Photo2URL   xsi:type="xsd:string" ></Photo2URL>
<Photo2Caption   xsi:type="xsd:string" ></Photo2Caption>
<Photo3URL   xsi:type="xsd:string" ></Photo3URL>
<Photo3Caption   xsi:type="xsd:string" ></Photo3Caption>
<Photo4URL   xsi:type="xsd:string" ></Photo4URL>
<Photo4Caption   xsi:type="xsd:string" ></Photo4Caption>
         <ProductID   xsi:type="xsd:integer" >5</ProductID>
         <NumberOfSales   xsi:type="xsd:integer" >6</NumberOfSales>
         <FocusProduct   xsi:type="xsd:string" >Yes</FocusProduct>
         <ProductID   xsi:type="xsd:integer" >7</ProductID>
         <NumberOfSales   xsi:type="xsd:integer" >6</NumberOfSales>
         <FocusProduct   xsi:type="xsd:string" >Yes</FocusProduct>

PHP: clientCanon.php

$requestPath = "eventsCanon.xml";
// Calls the file name containing the data
$url = "";  
// fake key - obviously!

$request = file_get_contents($requestPath);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
// what to post
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);

print $result;


Download the files here:


Please send comments to

Subscribe now to get the latest from the CustomerGauge Blog
See our Privacy Policy and GDPR terms.
More On This Topic
Loading Symbol