Difference between revisions of "API Method PracticeVettedToggle"
From Updox API
(Created page with " == Description == The following code samples describe the processes involved in manually setting the Vetted status an existing practice. == Prerequisites == # Thi...") |
(→Description) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
− | The following code samples describe the processes involved in manually | + | FOR QA REGION ONLY. |
− | + | ||
− | + | The following code samples describe the processes involved in manually toggling the Vetted status for existing practice. | |
− | + | ||
== Prerequisites == | == Prerequisites == | ||
# This API call requires [[Vendor credentialing|Vendor-level credentials]]. The credentials should be populated into the <code>applicationId</code> and <code>applicationPassword</code> fields of the <code>auth</code> block. | # This API call requires [[Vendor credentialing|Vendor-level credentials]]. The credentials should be populated into the <code>applicationId</code> and <code>applicationPassword</code> fields of the <code>auth</code> block. | ||
Line 23: | Line 23: | ||
{{Core Method Header - CSharp}} | {{Core Method Header - CSharp}} | ||
− | {{Json | + | {{Json PracticeVettedToggle Block - CSharp}} |
{{Json Auth Block - Application - CSharp}} | {{Json Auth Block - Application - CSharp}} | ||
− | {{Core Method Footer - CSharp| | + | {{Core Method Footer - CSharp|practiceVettedToggle|practiceVettedToggle}} |
{{Base_Code_for_Consuming_API_Using_CSharp}} | {{Base_Code_for_Consuming_API_Using_CSharp}} | ||
Line 32: | Line 32: | ||
| align="top" | Java || <div class="mw-collapsible mw-collapsed" style="width:65px"> | | align="top" | Java || <div class="mw-collapsible mw-collapsed" style="width:65px"> | ||
<div class="mw-collapsible-content" style="width:810px"> | <div class="mw-collapsible-content" style="width:810px"> | ||
− | {{Talk To Updox - Core - Java| | + | {{Talk To Updox - Core - Java|practiceVettedToggle|practiceVettedToggle}} |
− | {{Json | + | {{Json PracticeVettedToggle Block - Java}} |
{{Base_Code_for_Consuming_API_Using_Java}} | {{Base_Code_for_Consuming_API_Using_Java}} | ||
Line 46: | Line 46: | ||
=== Destination Address === | === Destination Address === | ||
<div style="width:500px;"> | <div style="width:500px;"> | ||
− | {{Base url api| | + | {{Base url api|practiceVettedToggle|practiceVettedToggle}} |
</div> | </div> | ||
=== Request JSON === | === Request JSON === | ||
<div style="width:500px;"> | <div style="width:500px;"> | ||
− | {{Json Request | + | {{Json Request PracticeVettedToggle}} |
</div> | </div> | ||
Line 61: | Line 61: | ||
=== Response JSON === | === Response JSON === | ||
<div style="width:500px;"> | <div style="width:500px;"> | ||
− | {{Json Response | + | {{Json Response PracticeVettedToggle}} |
</div> | </div> | ||
Latest revision as of 14:58, 19 December 2013
Contents |
Description
FOR QA REGION ONLY.
The following code samples describe the processes involved in manually toggling the Vetted status for existing practice.
Prerequisites
- This API call requires Vendor-level credentials. The credentials should be populated into the
applicationId
andapplicationPassword
fields of theauth
block. - This API call requires an
accountId
to be passed outside theauth
block.
Code Samples
Language | Source Code Examples |
---|---|
C# |
public void TalkToUpdox() { string json = new JavaScriptSerializer().Serialize(new { accountId = "myPracticeId", auth = new { applicationId = "vendorId", applicationPassword = "vendorPassword", accountId = "", userId = "" } }); string url = "https://updoxqa.com/io/practiceVettedToggle"; 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/practiceVettedToggle"; 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("accountId","myPracticeId"); //required 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
{ "accountId": "myPracticeId", "auth": { "applicationId": "vendorId", "applicationPassword": "vendorPassword", "accountId": "", "userId": "" } }
HTTP Response Status
200 OK
Response JSON
{ "successful": true, "responseMessage": "OK", "responseCode": 2000 }
Relevant Response Codes
In addition to the General Error Set, this method may return the following values in the responseCode
and responseMessage
fields:
responseCode
|
responseMessage
|
---|---|
4131
|
account does not exist
|