consumerquery

Execute a customized query against Consumers table in 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: “consumerquery”.

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

  • txtParameter field contains a structure like this:

<?xml version="1.0" encoding="utf-8" ?>
<consumerquery>
	<fields>*</fields>
	<where>
		<field><![CDATA[ lastPosDate ]]></field>
		<comparison><![CDATA[ > ]]></comparison>
		<value><![CDATA[ 20131231235959 ]]></value>
	</where>
	<order>lastPosDate DESC</order>
	<time>20101025183000</time>
</consumerquery>
{
  "consumerquery": {
    "fields": "*",
    "where": {
      "field": " lastPosDate ",
      "comparison": " > ",
      "value": " 20131231235959 "
    },
    "order": "lastPosDate 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.

  • <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 tracks greater than this value.

  • <maxitem> optional. Used for paging results. If set returns tracks lesser 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” + “time” + “generated character to 32”.

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


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

Returns a structure like the following:

<?xml version="1.0" encoding="utf-8" ?>
<furesult>
	<message><![CDATA[ OK ]]></message>
	<schema table="Consumers">
		... schema in XML ...
	</schema>
	<Consumers>
		... recordset in XML ...
	</Consumers>
</furesult>
{
  "furesult": {
    "message": " OK ",
    "schema": {
      "@table": "Consumers",
        ... schema in JSON ...
    },
    "Consumers": {
      ... 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)
  • <Consumers> this tag has the table name: Consumers

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