Forum Discussion
Hi AdamN,
That is awesome new for you. Today, i tried really hard to use Javascript covert XML2Array or XML2JSON, Not much luck.
Am I right here?
So, in my community URL for fedrated search is from XML
http://discussions.tomtom.com/tomtom/restapi/vc/search/messages?phrase=map&page_size=10&restapi.response_style=view
to JSON will be:
discussions.tomtom.com//tomtom/restapi/vc/search/messages?phrase=map&page_size=10&xslt=json.xsl
That looks right. Here is an example from Lithosphere using your code:
http://lithosphere.lithium.com/restapi/vc/search/messages?phrase=map&page_size=10&xslt=json.xsl
- qinglau14 years agoMentor
Hello Guys,
Thanks all the help so far. We have kind of prove of concept of Federated search in RightNow page.In order to complete the Function, I would like to know the return JSON object length. Does Lithium has a standard way to get "length" of JSON object, or i have to create a Function by myself, like:
Function countProperties(obj) { var prop; var propCount = 0; for (prop in obj) { propCount++; } return propCount; }
Thanks.
- qinglau14 years agoMentorHello Guys,
I have found that RightNow has a standard JSON.parse function. So, I can convert JSON into arrays, and get the length
like
var decodedStr = RightNow.JSON.parse(o.responseText);
var newdata=decodedStr.response
var length= newdata.messages.message.length;
Thanks- qinglau14 years agoMentor
Hello All,
I have some follow up questions.
1. Is there any ways for bring back only "accepted solution" response as a JSON object?
According to the post here, it explain that it will need to threadID to make other calls. Like:
http://<your community domain path>/restapi/vc/threads/id/thread_id .
We would like avoid these complex implementation in RightNow end and also do not want increase RESETAPI page views. BT has a perfect implementation in this case: http://bt.custhelp.com/app/home
2. Get lastest "Accepted Solutions" VIA JSON object.
Can we get the accepted solutions response as a JSON object, not XML
http://lithosphere.lithium.com/t5/Customer-Connection-Private/Accepted-Solutions-via-REST/td-p/18648
If yes, how the URL should look like?
Thanks,
Qing Liu
Related Content
- 12 years ago