query

Execute a customized query against MyWakes database returning a result in XML/JSON format.

Command's fields description:

  • txtUser1 field is the “username” of MyWakes account.

  • txtUser2 field is the “password” of MyWakes account.

  • txtCommand field contains the command: “query”.

  • txtFormat optional field specifies txtParameters and response formats. more info.

  • txtParameter field contains a structure like this:

<?xml version="1.0" encoding="utf-8" ?>
<query>
	<fields>*</fields>
	<table>Tracks</table>
	<where>
		<field><![CDATA[ startTime ]]></field>
		<comparison><![CDATA[ > ]]></comparison>
		<value><![CDATA[ 20101231235959 ]]></value>
	</where>
	<where>
		<field><![CDATA[ AND ]]></field>
	</where>
	<where>
		<field><![CDATA[ length ]]></field>
		<comparison><![CDATA[ > ]]></comparison>
		<value><![CDATA[ 100 ]]></value>
	</where>
	<order>length DESC</order>
	<time>20101025183000</time>
</query>
{
  "query": {
    "fields": "*",
    "table": "Tracks",
    "where": [
      {
        "field": " startTime ",
        "comparison": " > ",
        "value": " 20101231235959 "
      },
      { "field": " AND " },
      {
        "field": " length ",
        "comparison": " > ",
        "value": " 100 "
      }
    ],
    "order": "length DESC",
    "time": "20101025183000"
  }
}

 

Where

  • <schema> optional. Sets what have to be returned, can be:

    • 0 (zero). Returns query data without schema.
    • 1 (one). Returns query data along with the schema.
    • 2. Returns only the schema.
  • <fields> optional. The list of fields, separated by “,” (comma). Special character “*” returns all fields.

  • <table> mandatory. The table on which execute the query. It is possibile to execute the query only on one table at a time. The list of allowed table is the following:

    • Actions. List of user defined actions.
    • Alarms. List of alarms and notifications.
    • AppLog. Log of your ApplicationId calls.
    • ChartFiles. List of users' maps.
    • Consumers. List of users' consumers.
    • EmailLog. List of sent mail.
    • GeoAreas. Virtual fences.
    • GoogleFiles. List of Kml/Kmz users' files.
    • GpsKeep. List of users' KeepWay.
    • GpsKitt. List of users' KittWay.
    • GpsPhone. List of users' PhoneWay.
    • GpsPhonePlus. List of users' PhoneWayPro.
    • GpsPick. List of users' PickWay.
    • GpsOthers. List of users' devices.
    • GpsTomTom. List of users' TomTom.
    • MessagesReceived. List of received messages.
    • MessagesSent. List of sent messages.
    • OBDII. Consumers' OBD data collection.
    • PhoneLog. List of vocal calls.
    • PointsOfInterest. List of POIs.
    • SmsLog. List of sent SMS.
    • Tracks. List of users' tracks.
    • TrackPoints. Users' tracks point.
    • Users. Users' details and preferences.
    • WebLog. List of WEB calls (GET and POST).
  • <where> optional. Clause WHERE of SELECT command. There can be more occurrences of this tag. If present it must contain the following tags:

    • <field> può contenere i seguenti elementi:
      • “(” open parenthesis. <comparision> and <value> tags are ignored and can be omitted.
      • “)” closed parenthesis. <comparision> and <value> tags are ignored and can be omitted.
      • “AND” logic operator. <comparision> e <value> tags are ignored and can be omitted.
      • “OR” logic operator. <comparision> e <value> tags are ignored and can be omitted.
      • “NOT” logic operator. <comparision> e <value> tags are ignored and can be omitted.
      • Field name: the name of the field to compare.
    • <comparision> Comparison operator. Can be:
      • “=”: equal.
      • “<”: lower then.
      • “>”: greater then.
      • “<=”: lower/equal then.
      • “>=”: greater/equal than.
      • “<>”: different.
      • “LIKE”: similar, jolly character can be:
        • “%”: any string of zero or more characters. For instance '%computer%' gets all strings that contain “computer” word.
        • “_”: any single character. For instance '_ean' gets all 4-characters words that ends with “ean” (like Dean, Sean etc).
        • “[]”: single character included into an interval ([a-f]) or between a given set ([abcdef]). For instance '[C-P]arsen' returns all strings ending with “arsen” and beginning with a character from “C” to “P” like Carsen, Larsen, Karsen etc.
        • “[^]”: single character not included ingo an interval ([^a-f]) or into specified set ([^abcdef]). For instance 'de[^l]%' gets all strings beginning with “de” and next letter is different from “l”.
      • “IS NULL”: is null. <value> tag is ignored and can be omitted.
      • “IS NOT NULL”: not null. <value> tag is ignored and can be omitted.
    • <value> contains the value to compare. For numeric values the decimal separator is <.> (dot), dates are in <yyyyMMddhhmmss> format expressed in UTC time
  • <order> optional. ORDER BY clause of SELECT command. It is possibile to order by more than one field separating them with <,> (comma). For each field it is mandatory to specify ASC or DESC option.

  • <minitem> optional. Used for paging results. If set returns rows greater than this value.

  • <maxitem> optional. Used for paging results. If set returns rows less than this value. Note that order to prevent your system from being flooded with oversized responses, the number of messages that will be returned on a single response is limited to 500.

  • <time> mandatory, date and time in UTC. The accepted format is “yyyyMMddhhmmss”.

  • txtProvider field must contain the application calling ID and generated characters.

  • txtSignature field must contain the signature based on the string made of “Command Name” + “table name” + “time” + “generated character to 32”.

Looking at the previous example, the string on which calculate the check will be:
“queryTracks2010102518300010xxxxx”


Therefore the txtProvider field will be:
“76a865d4-fab8-51cd-ba78-2da325f6955axxxxx”

Returns a structure like the following:

<?xml version="1.0" encoding="utf-8" ?>
<furesult>
	<message><![CDATA[ OK ]]></message>
	<schema table="Tracks">
		... schema in XML ...
	</schema>
	<Tracks>
		... recordset in XML ...
	</Tracks>
</furesult>
{
  "furesult": {
    "message": " OK ",
    "schema": {
      "@table": "Tracks",
        ... schema in JSON ...
    },
    "Tracks": {
      ... recordset in JSON ...
    }
  }
}

 

Where

  • <message> contains OK or Error description
  • <schema> table schema (present only if schema parameter is set to 1 (one) or 2 (two)
  • <Tracks> this tag has the table name (in this example is “Tracks” but if the table is different, for instance “Actions” this tag will be <Actions>)

If MyWakes server returns an error, the format of this answer is described in the error section.

Terms Of Use | Privacy Statement | Company info
  • © Cedac Sistemi srl
  • Head office: Via Toscana, 3 40035 Castiglione dei Pepoli (Italy) Tel.: +39 0534-93811 Fax: +39 0534-93899
  • Branch office: Via del Lavoro, 47 40033 Casalecchio di Reno (Italy)
  • Branch office: Via Parini, 1 40033 Casalecchio di Reno (Italy)
  • Share capital Euro 26,000.00 - Company Register of Bologna / VAT no / fiscal code 01695261204