1 Reply Latest reply: Jun 4, 2009 9:30 AM by 513533 RSS

    How to fetch all Contacts?


      I would like to retrieve all contacts for a user. Therefore, I used the following code:

      Session session = getSession();
      Handle[] agendas = { new Handle() };
      String[] properties = new String[0];
      RequestResult results = new RequestResult();
      Query query = new Query( "N", Query.CSDK_OP_GE, "0" );
      session.authenticate(Api.CSDK_FLAG_NONE, USER, PASSWORD);
      agendas[0] = session.getHandle(Api.CSDK_FLAG_NONE, USER);
      String contacts = session.fetchContactsByQuery(Api.CSDK_FLAG_STREAM_NOT_MIME, query, properties, results );

      but no results are returned.
      However, if I use the following query the method does return the corresponding contacts (so, there are actually contacts to fetch):

      query = new Query("TITLE", Query.CSDK_OP_GE, "0");

      Can anyone tell me how to get all contacts corresponding to a user?
      Any suggestions would be greatly appreciated!


      Edited by: user7728432 on 21-May-2009 02:27