Difference between revisions of "API Method FaxBulkIdRetrieve"

From Updox API
Jump to: navigation, search
(Created page with "== Description == The following describes the processes involved in retrieving information regarding previously sent bulk faxes. == Prerequisites == {{PreReq Vendor Crede...")
 
(Description)
 
(5 intermediate revisions by one user not shown)
Line 2: Line 2:
 
The following describes the processes involved in retrieving information regarding previously sent bulk faxes.
 
The following describes the processes involved in retrieving information regarding previously sent bulk faxes.
  
 +
This must correspond to the bulkFaxId returned by a previous call to FaxBulkSend(). A valid fax number is greater than zero.
  
 
+
A valid response will contain a list of individual fax IDs for those faxes within the bulk batch that have already been sent.
 +
Note that the returned list will likely be incomplete if called immediately after the FaxBulkSend() request because all faxes might not yet have been processed.
  
 
==  Prerequisites ==
 
==  Prerequisites ==
Line 11: Line 13:
 
{{PreReq Account Identifier}}
 
{{PreReq Account Identifier}}
  
 +
 +
 +
== Code Samples ==
 +
{| class="wikitable" style="width:900px; vertical-align:top; align:left"
 +
! Language || Source Code Examples
 +
|-
 +
| width="50px"| C# || <div class="mw-collapsible mw-collapsed" style="width:65px">
 +
<div class="mw-collapsible-content" style="width:810px">
 +
 
 +
{{Core Method Header - CSharp}}
 +
{{Json BulkFaxRetrieve Block - CSharp}}
 +
{{Json Auth Block - Account - CSharp}}
 +
{{Core Method Footer - CSharp| faxBulkIdRetrieve | faxBulkIdRetrieve}}
 +
 
 +
{{Base_Code_for_Consuming_API_Using_CSharp}}
 +
</div>
 +
|-
 +
| align="top" | Java || <div class="mw-collapsible mw-collapsed" style="width:65px">
 +
<div class="mw-collapsible-content" style="width:810px">
 +
{{Talk To Updox - Core - Java| faxBulkIdRetrieve | faxBulkIdRetrieve}}
 +
 
 +
{{Json faxBulkIdRetrieve Block - Java}}
 +
 
 +
{{Base_Code_for_Consuming_API_Using_Java}}
 +
|}
  
  
Line 21: Line 48:
 
=== Request JSON ===
 
=== Request JSON ===
 
<div style="width:500px;">
 
<div style="width:500px;">
{{Json Request BulkFax}}
+
{{Json Request faxBulkIdRetrieve}}
 
</div>
 
</div>
  
Line 31: Line 58:
 
=== Response JSON ===
 
=== Response JSON ===
 
<div style="width:500px;">
 
<div style="width:500px;">
{{Json Response BulkFax}}
+
{{Json Response faxBulkIdRetrieve}}
 
</div>
 
</div>
  
Line 46: Line 73:
 
4060: Field validation error -- Message varies
 
4060: Field validation error -- Message varies
  
4931: BulkFaxId DNE or not related to current practice
+
4931: BulkFaxId does not exist or is unrelated to current practice

Latest revision as of 11:26, 1 July 2015

Contents

Description

The following describes the processes involved in retrieving information regarding previously sent bulk faxes.

This must correspond to the bulkFaxId returned by a previous call to FaxBulkSend(). A valid fax number is greater than zero.

A valid response will contain a list of individual fax IDs for those faxes within the bulk batch that have already been sent. Note that the returned list will likely be incomplete if called immediately after the FaxBulkSend() request because all faxes might not yet have been processed.

Prerequisites

1 This API call requires Vendor-level credentials. The credentials should be populated into the applicationId and applicationPassword fields of the auth block:

 {
   ...
   "auth": {
     "applicationId": "vendorId",
     "applicationPassword": "vendorPassword",
     "accountId": "",
     "userId": ""
   }
 }
 
 

2 This API call requires a Practice/Account-level identifier. The identifier should be populated into the accountId field of the auth block:

 {
   ...
   "auth": {
     "applicationId": "vendorId",
     "applicationPassword": "vendorPassword",
     "accountId": "practiceId",
     "userId": ""
   }
 }


Code Samples

Language Source Code Examples
C#
 public void TalkToUpdox() {
   string json = new JavaScriptSerializer().Serialize(new {
       bulkFaxId = 56,
     auth = new {
       applicationId = "vendorId",
       applicationPassword = "vendorPassword",
       accountId = "accountId",
       userId = ""
     }
   });
   string url = "faxBulkIdRetrieve  https://updoxqa.com/io/ faxBulkIdRetrieve";
   SendReceiveJSON(json, url);
 }
 
 private void SendReceiveJSON(string json, string url)
 {
   var httpWebRequest = WebRequest.Create(url);
   httpWebRequest.ContentType = "application/json";
   httpWebRequest.Method = "POST";
   using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
   {
     streamWriter.Write(json);
     streamWriter.Flush();
     streamWriter.Close();
     var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse();
     using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
     {
       var result = streamReader.ReadToEnd();
     }
   }
 }
Java


   public void TalkToUpdox() throws Exception {
       String uri = "faxBulkIdRetrieve  https://updoxqa.com/io/ faxBulkIdRetrieve";
       ObjectMapper mapper = new ObjectMapper();
       Map<String,Object> messageData = BuildMessage();
       String jsonData = mapper.writeValueAsString(messageData);
       HttpResponse httpResponse = SendReceiveJSON(jsonData, uri);
       HttpEntity responseEntity = httpResponse.getEntity();
       String response = EntityUtils.toString(responseEntity);
       JsonNode actualObj = mapper.readTree(response);
 
       System.out.println(actualObj.get("responseCode"));
       System.out.println(actualObj.get("responseMessage"));
   }
 
   private Map<String,Object> BuildMessage() throws Exception
   {
       Map<String,Object> messageData = new HashMap();
       messageData.put("bulkFaxId", 56);
       authData.put("applicationId", "vendorId");
       authData.put("applicationPassword", "vendorPassword");
       authData.put("accountId", "accountId");
 
       return messageData;
   }
 
   private HttpResponse SendReceiveJSON(String jsonData, String uri) throws Exception {
       HttpClient httpClient = new DefaultHttpClient();
       HttpResponse response = null;
       StringEntity params = new StringEntity(jsonData);
       try {
           HttpPost request = new HttpPost(uri);
           request.addHeader("content-type", "application/json");
           request.setEntity(params);
           response = httpClient.execute(request);
       } catch (Exception ex) {
           // handle exception here
       } finally {
           httpClient.getConnectionManager().shutdown();
       }
       return response;
   }


Messages

Destination Address

 https://updoxqa.com/io/faxBulkIdRetrieve

Request JSON

{

   "bulkFaxId": 36

}

HTTP Response Status

 200 OK

Response JSON

{

 "successful": true,
 "responseMessage": "OK",
 "responseCode": 2000,
 "completedFaxes": [23, 24, 25, 30, 32]

}

Response Codes

2000: OK

4000: Bad Request

4010: Unauthorized (bad applicationId or applicationPassword)

4011: Unauthorized (bad accountId)

4060: Field validation error -- Message varies

4931: BulkFaxId does not exist or is unrelated to current practice