Difference between revisions of "API Method EventNotificationStatusesGetByInternalIds"
From Updox API
(→Error Codes) |
|||
(3 intermediate revisions by one user not shown) | |||
Line 24: | Line 24: | ||
{{Core Method Header - CSharp}} | {{Core Method Header - CSharp}} | ||
− | {{Json | + | {{Json InternalIds Block - CSharp}} |
{{Json Auth Block - Account - CSharp}} | {{Json Auth Block - Account - CSharp}} | ||
{{Core Method Footer - CSharp|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | {{Core Method Footer - CSharp|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | ||
Line 35: | Line 35: | ||
{{Talk To Updox - Core - Java|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | {{Talk To Updox - Core - Java|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | ||
− | {{Json | + | {{Json InternalIds Block - Java}} |
{{Base_Code_for_Consuming_API_Using_Java}} | {{Base_Code_for_Consuming_API_Using_Java}} | ||
|} | |} | ||
− | |||
− | |||
== Messages == | == Messages == | ||
=== Destination Address === | === Destination Address === | ||
− | <div style="width: | + | <div style="width:600px;"> |
{{Base url api|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | {{Base url api|eventNotificationStatusesGetByInternalIds|eventNotificationStatusesGetByInternalIds}} | ||
</div> | </div> | ||
Line 65: | Line 63: | ||
− | == | + | == Response Codes == |
− | This method may return the [[General Error Set]]. | + | |
+ | 5012 At least one id must be specified for the get request | ||
+ | |||
+ | |||
+ | This method may also return the [[General Error Set]]. |
Latest revision as of 13:16, 16 December 2015
Contents |
Description
Method that gets the event notification statuses by event notification internal IDs
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 { internalIds = new[] { "internal-id-for-1", "internal-id-for-2", "internal-id-for-3" }, auth = new { applicationId = "vendorId", applicationPassword = "vendorPassword", accountId = "accountId", userId = "" } }); string url = "https://updoxqa.com/io/eventNotificationStatusesGetByInternalIds"; 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 = "https://updoxqa.com/io/eventNotificationStatusesGetByInternalIds"; 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 { List<String> internalIds = new ArrayList<>(); internalIds.add("internal-id-for-1"); internalIds.add("internal-id-for-2"); internalIds.add("internal-id-for-3"); Map<String,Object> messageData = new HashMap(); messageData.put("internalIds", eventNotificationIds); Map<String,String> authData = new HashMap(); authData.put("applicationId", "vendorId"); authData.put("applicationPassword", "vendorPassword"); messageData.put("auth", authData); 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
Request JSON
{ "internalIds": [ "internal-id-for-1", "internal-id-for-2", "internal-id-for-3" ], "auth": { "applicationId": "vendorId", "applicationPassword": "vendorPassword", "accountId": "accountId", "userId": "" } }
HTTP Response Status
200 OK
Response JSON
{ "successful": true, "responseMessage": "OK", "responseCode": 2000, "eventNotificationStatuses": [ { "notificationId": 1, "internalId": "internal-id-for-1", "status": "confirmed", "statusDate": "12/11/2015", "reply": "reply texts" }, { "notificationId": 2, "internalId": "internal-id-for-2", "status": "cancelled", "statusDate": "12/12/2015", "reply": "reply texts" }, { "notificationId": 3, "internalId": "internal-id-for-3", "status": "sent", "statusDate": "12/13/2015", "reply": "N/A" } ] }
Response Codes
5012 At least one id must be specified for the get request