bool FilterSubstringRequestJSON::parseJson(const QByteArray &data)
{
  clearContainers();

  QJson::Parser parser;
  bool ok;
  QVariantMap result = parser.parse(data, &ok).toMap();

  if(!ok) return false;

  QString field = result["field"].toString();
  QString substring = result["substring"].toString();
  QString auth_token = result["auth_token"].toString();
  qulonglong tagNumber = result["tag_number"].toULongLong(&ok);
  if (ok) m_tagNumber = tagNumber;

  if ( !Tag::isFieldNameValid(field) || substring.isEmpty() || auth_token.isEmpty())
    return false;

  setField(field);
  setSubstring(substring);
  setSessionToken(auth_token);

  return true;
}
void ParseClient::clearSessionToken() {
  setSessionToken(NULL);
}