<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.smt-x.com/index.php?action=history&amp;feed=atom&amp;title=Retrieving_all_service_details_through_public_API</id>
	<title>Retrieving all service details through public API - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.smt-x.com/index.php?action=history&amp;feed=atom&amp;title=Retrieving_all_service_details_through_public_API"/>
	<link rel="alternate" type="text/html" href="https://wiki.smt-x.com/index.php?title=Retrieving_all_service_details_through_public_API&amp;action=history"/>
	<updated>2026-04-03T22:03:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://wiki.smt-x.com/index.php?title=Retrieving_all_service_details_through_public_API&amp;diff=368&amp;oldid=prev</id>
		<title>Smtxwiki: Created page with &quot;The javascript below retrieves all services through the available API and per retrieved service, the details of the service is retrieved through an additional API call.   &lt;now...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.smt-x.com/index.php?title=Retrieving_all_service_details_through_public_API&amp;diff=368&amp;oldid=prev"/>
		<updated>2021-03-30T20:31:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The javascript below retrieves all services through the available API and per retrieved service, the details of the service is retrieved through an additional API call.   &amp;lt;now...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The javascript below retrieves all services through the available API and per retrieved service, the details of the service is retrieved through an additional API call.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;var getObjectByValue = function(array, key, value) {&lt;br /&gt;
    return array.filter(function(object) {&lt;br /&gt;
        return object[key] === value;&lt;br /&gt;
    });&lt;br /&gt;
};&lt;br /&gt;
var getServicePartValue = function(array, partname) {&lt;br /&gt;
    var partarray = array.filter(function(object) {&lt;br /&gt;
        return object.name === partname;&lt;br /&gt;
    });&lt;br /&gt;
    if (partarray.length) {&lt;br /&gt;
        return partarray[0].value;&lt;br /&gt;
    }&lt;br /&gt;
    return &amp;#039;&amp;#039;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var allServices = JSON.parse(CommonInterface.callWebservice(&amp;#039;Services: get all via public api&amp;#039;, {}));&lt;br /&gt;
var allApprovalMappings = JSON.parse(CommonInterface.getAllParameterEntries(&amp;#039;ScApprovaMapping&amp;#039;));&lt;br /&gt;
&lt;br /&gt;
var serviceGuid = &amp;#039;&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
for (var i = 0; i &amp;lt; allServices.length; i++) {&lt;br /&gt;
    serviceGuid = allServices[i].guid;&lt;br /&gt;
    serviceDetails = JSON.parse(CommonInterface.callWebservice(&amp;#039;Services: get service details via public api&amp;#039;, {&lt;br /&gt;
        &amp;#039;ServiceGuid&amp;#039;: serviceGuid&lt;br /&gt;
    }));&lt;br /&gt;
    if (serviceDetails) {&lt;br /&gt;
        var overviewparts = [];&lt;br /&gt;
        // merge all tabs together for easier browsing&lt;br /&gt;
        for (var j = 0; j &amp;lt; serviceDetails.datatabs.length; j++) {&lt;br /&gt;
            if (serviceDetails.datatabs[j].name === &amp;quot;Overview&amp;quot;) {&lt;br /&gt;
                overviewparts = serviceDetails.datatabs[j].parts;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
		// Example line how to get the field Competence Center from the returned details&lt;br /&gt;
        var CompetenceCenter = getServicePartValue(overviewparts, &amp;quot;Competence Center&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return 1;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Smtxwiki</name></author>
	</entry>
</feed>