Post

2 followers Follow
0
Avatar

PHP CZQL with Web Service

How do I run a CZQL query with the web service and not the REST API?  I have looked at the web service documentation and it says it is supported, but I do not see an example of how to use it.

 

I am trying to run a simple query provided by the API documentations.  My sample is below and I get the error message "Missing argument: Query Text".

 

    $userQuery = new stdClass();

     $userQuery->q = "SELECT Name, StartDate, Manager FROM Task WHERE StartDate>2015-03-21 ORDER BY StartDate DESC";

 

    $request[] = new SoapVar(
        $userQuery,
        SOAP_ENC_OBJECT,
        'CZQLQuery',
        $soapApiUrl
    );

    $result = $client->Execute(array("request"=>$request));
if($result) {

    if (!displayErrors($result))

        var_dump($result);

    }
}

Simon Answered

Please sign in to leave a comment.

4 comments

0
Avatar

I have tried that and I still get the same error message.

 

 

  • ErrorCode : MissingArgument
  • Message : Missing argument: Query Text

     $userQuery->QueryText = "SELECT Name, StartDate, Manager FROM Task WHERE StartDate>2015-03-21 ORDER BY StartDate DESC";

 

Simon 0 votes
Comment actions Permalink
0
Avatar

That looks like it worked.  I am getting results.  Thanks

 

     $userQuery->Text = "SELECT Name, StartDate, Manager FROM Task WHERE StartDate>2015-03-21 ORDER BY StartDate DESC";

Simon 0 votes
Comment actions Permalink