We help IT Professionals succeed at work.

How do I code/send an XML file for WAPI?

Matthew Starr
Matthew Starr asked
on
This is totally out of my realm of expertise, so I apologize in advance for any poor form and incorrect assumptions. Feel free to ask for clarification.

My company uses a CRM to track calls/emails (inquiries), which has a toolkit that can pull reports given certain parameters. Unfortunately, these reports limit the amount of text included in any field to 250 characters. According to this CRMs customer support team, I have to use their API (or WAPI, not sure if they are different) to circumvent this character limit. I tried downloading bitvise and connecting to the host using the information they provided, but it didn't work. They said I "need to code my own xml data to get the data".

I think, given some time, I can figure out how to code the XML file (they have provided some instruction in this area), but I'm at a total loss as to what to do with it! How do I even connect to the WAPI? I feel really hamstrung at the moment, so any advice would be greatly appreciated. Thanks in advance!
Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2008

Commented:
I am guessing that WAPI is WebAPI, which would be a specific implementation of an API.  

There isn't quite enough information here to figure out what you need...

Author

Commented:
I figured that would be the case - what other information can I provide?
Most Valuable Expert 2012
Top Expert 2008

Commented:
1) "Unfortunately, these reports limit the amount of text included in any field to 250 characters"
What reports, type of report system, ...?

2) What design platform/version (if any) are you working with (Visual Studio, Web Matrix, ...)?

3) What should bitvise do for you?

4) What is the "bigger picture" from the 30000 meter view?

Author

Commented:
1) The reports are generated by 8x8 (our CRM) in CSV format and list customer interactions for each of our agents. They contain client information, processing time, a description of the case, etc. The description, which contains the summary of the case and/or any email correspondence between agent/client, is what usually goes beyond that 250 character limit. Since we have to review many cases at once, it is helpful to have the full body of text contained within the description field, rather than navigating to the cases within the web client and copying them over one by one.

2) I'm not currently working with any platform, as far as I know.

3) I have learned through the 8x8 customer support team that bitvise won't do anything, apparently.

4) Bigger picture is this: I want to define parameters for a given time period and download a report containing the case information I need.

To do this, I am told I need to code/send an XML. They gave me an example HTML file to look at open cases, but when I open it, it just displays a blank page... see below for most recent correspondence and content of sample HTML file (note: I changed the password)

"VCC Ops indicates you can't use a SSH client to log in to our site to do WAPI.  You would need to code your own xml file to get your data.  See attachment for a sample  on how to get open cases.  "

<html>
<body onload="document.xml.submit();">
<form action="http://vcc-na2.8x8.com/WAPI/wapi.php" name="xml">
<input type="hidden" name="xml_query" value='
<wapi>
<tenant>altheadx01</tenant>
<username>wapi</username>
<password>*PASSWORD*</password>
<command object="CASE" action="GET">
<status>Open</status>
</command>
</wapi>
'</form>
</body>
</html>
Most Valuable Expert 2012
Top Expert 2008

Commented:
"They gave me an example HTML file to look at open cases, but when I open it, it just displays a blank page"
Would you be able to attach the HTML that you have?

Author

Commented:
I opened the file in notepad and copied the text above - do you want the actual file?
Most Valuable Expert 2012
Top Expert 2008

Commented:
Sorry, in 30 seconds of reading, I didn't see that was the HTML.

I don't know if this is important or not, but this example uses the POST method:

http://sims.8x8.com/Documents/710710_3_Virtual_Contact_Center_CRM_API.pdf


<html>
<body onload="document.xml.submit();">
<form action=http://na3.mycontactual.com/WAPI/wapi.php
method="post" name="xml">
<input type="hidden" name="xml_query"
value='<wapi>
<tenant>AcmeJets</tenant>
<username>johnd</username>
<password>john123</password>
<command object="customer" action="get"> <firstname>Bill</firstname>
</command>
</wapi>'>
</form>
</body>
</html>

Open in new window

Author

Commented:
I get the same issue (blank white screen). Would you expect there to be an error message if the request isn't formatted correctly?

It may be that I just need to use 8x8 'Professional Services' support team to figure out what is going on here, but I was hoping to save the expense, and I'm usually pretty good at figuring these things out.
Most Valuable Expert 2012
Top Expert 2008

Commented:
When it comes to command line HTTP processing, I turn to CURL.  It will tell you if you have any issues sending the request.

http://curl.haxx.se/

CURL POST example:

<form method="POST" action="junk.cgi">
 <input type=text name="birthyear">
 <input type=submit name=press value=" OK ">
 </form>
And to use curl to post this form with the same data filled in as before, we could do it like:

 curl --data "birthyear=1905&press=%20OK%20"  http://www.example.com/when.cgi

Open in new window

Most Valuable Expert 2012
Top Expert 2008

Commented:
Another approach, if you have Chrome, might be to use the Postman extension to send the request:

https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm/related?hl=en

Author

Commented:
Bob, thank you for all your help! Postman looks really useful. Could you show me how to set it up for this request? Or perhaps point me towards a good resource for learning how to do it myself.

<html>
<body onload="document.xml.submit();">
<form action="http://vcc-na2.8x8.com/WAPI/wapi.php" name="xml">
<input type="hidden" name="xml_query" value='
<wapi>
<tenant>companyname</tenant>
<username>wapi</username>
<password>ReplaceMe</password>
<command object="CASE" action="GET">
<status>Open</status>
</command>
</wapi>
'</form>
</body>
</html>
Most Valuable Expert 2012
Top Expert 2008

Commented:
It might be a problem using Postman, since it needs to send to a URL, and that is an HTML request with multi-part form data.   I haven't used Postman to send that type of request before.

I did see this image in the 8x8 pdf that I linked to earlier.  It shows the Configuration Manager.  Is that something that you have access to?

8x8 Configuration Manager
Most Valuable Expert 2012
Top Expert 2008
Commented:
1) I installed the Postman Interceptor extension.

http://www.getpostman.com/docs/capture

2) I turned on Interceptor capture

3) I created an HTML file, and opened it in Chrome.

Postman Raw HTTP Request
4) Interceptor created the request for me in Postman

Author

Commented:
I appreciate the quick response! You've been really helpful. Thanks again.
Most Valuable Expert 2012
Top Expert 2008

Commented:
Does that mean that you got the response that you expected?

Author

Commented:
Well, I was able to run file in IE, but chrome is still giving me trouble... it just displays a blank page.