GET_Q_ENTRIES_INFO

CAS Tags
The GET_Q_ENTRIES_INFO function retrieves one or more messages from any NET SatisFAXtion queue (send, sending, sent, receiving, or received).  In the reply taglist from the server, each message is placed in a section that starts with the MESSAGE_HANDLE tag.  The contents of a message are not retrieved, but can be obtained by using GET_FILE_FUNCTION.

When preparing the taglist for this function, the specific queue to retrieve messages from must be provided with the Q_ID tag.  Messages for a specific user can be retrieved by providing the user's name with the USER_NAME tag.  Instead of retrieving all available messages, a specific message can be retrieved by providing a message handle with the SPECIFIED_MESSAGE_HANDLE tag.  You are encouraged to include a section filled with tags that you truly need, beginning with the RESPONSE_INCLUDE_ONLY tag, to limit the amount of data returned from the server.  

You must provide valid REGISTERED_NAME and REGISTERED_PASSWORD tags in the taglist for this function to execute.  This function allows a user to access their own messages, and a supervisor to access messages belonging to any user.

 
  Type Max Size Multiple Allowed
Function N/A No

Example #1 (ActiveX Interface):
function GetReceivedMessages()
  {
  var Tl, Sl;
  var Msg = "";

  Tl = CAS.New();
  CAS.AddTag(Tl,"GET_Q_ENTRIES_INFO","");
  CAS.AddTag(Tl,"REGISTERED_NAME","Fred");
  CAS.AddTag(Tl,"REGISTERED_PASSWORD","");
  CAS.AddTag(Tl,"USER_NAME","User2");
  CAS.AddTag(Tl,"Q_ID","Q_ID_RECEIVED");

  Sl = CAS.CreateSection(Tl,"RESPONSE_INCLUDE_ONLY","");
   CAS.AddTag(Sl,"SUBMIT_TIME",0);
   CAS.AddTag(Sl,"MESSAGE_COMPLETION_CODE","");
   CAS.AddTag(Sl,"RECEIVER_CSID","");
   CAS.AddTag(Sl,"PAGE_COUNT","");
  CAS.CloseSection(Sl);
   
    // Get messages on this already open session
  Tl = CAS.Send(Instance,Tl);
  
  if ( CAS.GetTag(Tl,"STATUS_NUM",0) == 0 )
    {
      // The number of messages is in the root of the reply taglist
    var QueueCount = CAS.GetTag(Tl,"NUMBER_OF_Q_ENTRIES",0);
    
      // Each message is in it's own section
    for (var index = 0; index < QueueCount; index++)
      {
      var st;

      Sl = CAS.OpenSection(Tl,"MESSAGE_HANDLE[" + index + "]");
        st = new Date(parseInt(CAS.GetTag(Sl,"SUBMIT_TIME",0)));
        Msg += CAS.GetTag(Sl,"MESSAGE_HANDLE",0) + ",";
        Msg += st + ",";
        Msg += CAS.GetTag(Sl,"MESSAGE_COMPLETION_CODE",0) + ",";
        Msg += CAS.GetTag(Sl,"RECEIVER_CSID",0) + ",";
        Msg += CAS.GetTag(Sl,"PAGE_COUNT",0) + "\r\n";
      CAS.CloseSection(Sl);
      }
    }
  else
    {
      // Return the error
    Msg = CAS.GetTag(Tl,"STATUS",0);
    }

  CAS.Delete(Tl);

  return(Msg);
  }

Example #2 (XML Interface):
function GetReceivedMessages()
  {
  var Tl, Msg = "";

  Tl = xmlTlNew();
  xmlTlAddTag(Tl,"GET_Q_ENTRIES_INFO","");
  xmlTlAddTag(Tl,"REGISTERED_NAME","Webclient");
  xmlTlAddTag(Tl,"REGISTERED_PASSWORD","");
  xmlTlAddTag(Tl,"USER_NAME","Webclient");
  xmlTlAddTag(Tl,"Q_ID","Q_ID_RECEIVED");

  xmlTlCreateSection(Tl,"RESPONSE_INCLUDE_ONLY","");
   xmlTlAddTag(Tl,"SUBMIT_TIME",0);
   xmlTlAddTag(Tl,"MESSAGE_COMPLETION_CODE","");
   xmlTlAddTag(Tl,"RECEIVER_CSID","");
   xmlTlAddTag(Tl,"PAGE_COUNT","");
  xmlTlCloseSection(Tl);
   
  var responseXML =
        xmlTlSend(Tl,
                  "\\\\CASDEV\\NETSATISFAXTION",
                  "NETSATISFAXTION",
                  2,
                  "http://casdev.faxback.com/cgi-bin/casxml.asp");
  
  if (xmlTlGetTag(responseXML,"STATUS_NUM") == 0 )
    {
      // The number of messages is in the root of the reply taglist
    var QueueCount = xmlTlGetTag(responseXML,"NUMBER_OF_Q_ENTRIES");
    
      // Each message is in it's own section
    for (var i = 0; i < QueueCount; i++)
      {
        // Build string from message handle + submit time + completion
        // code + CSID + page count

      Msg += xmlTlGetTag(responseXML,
               "MESSAGE_HANDLE["+i+"]") + ",";

      Msg += new Date(parseInt(xmlTlGetTag(responseXML,
               "MESSAGE_HANDLE["+i+"]/SUBMIT_TIME"))) + ",";

      Msg += xmlTlGetTag(responseXML,
               "MESSAGE_HANDLE["+i+"]/MESSAGE_COMPLETION_CODE")+",";

      Msg += xmlTlGetTag(responseXML,
               "MESSAGE_HANDLE["+i+"]/RECEIVER_CSID") + ",";

      Msg += xmlTlGetTag(responseXML,
               "MESSAGE_HANDLE["+i+"]/PAGE_COUNT") + "\r\n";
      }
    }
  else
    {
      // Return the error
    Msg = xmlTlGetTag(responseXML,"STATUS");
    }

  return(Msg);
  }

See Also:
Get Q Entries Info, GET_FILE_FUNCTION, SEND_MESSAGE, Q_ID, SPECIFIED_MESSAGE_HANDLE, RESPONSE_INCLUDE_ONLY, MESSAGE_COMPLETION_CODE, PAGE_COUNT, CONNECTION_SECONDS