Get Sites Metadata

Fetches Site Metadata

This API return metadata currently active on the site

 

API Details

Signature of the API

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general

Parameter 1: uri

metadataService.do

Parameter 2: realUserName

Username of the site admin

Parameter 3: requestParameters

Name Value
dispatch getSiteMetadata

 

Response

On Success:

HTTP Response Code = HttpServletResponse.SC_OK

Sample response

<response code="0">
    <msgs>
        <msg>
            <code>0</code>
            <value>
                <![CDATA[Success]]>
            </value>
        </msg>
    </msgs>
    <data>
        <METADATA>
            <SUBJECTS>
                <SUBJECT ID="10" NAME="new name">
                    <SUBJECTS>
                        <SUBJECT ID="10.10" NAME="new name">
                            <SUBJECTS>
                                <SUBJECT ID="10.10.10" NAME="new name"/>
                            </SUBJECTS>
                        </SUBJECT>
                    </SUBJECTS>
                </SUBJECT>
            </SUBJECTS>
            <SKILL_LEVELS>
                <SKILL_LEVEL ID="10" NAME="new name"/>
                <SKILL_LEVEL ID="20" NAME="new name"/>
            </SKILL_LEVELS>
            <COMPLEXITIES>
                <COMPLEXITY ID="10" NAME="new name"/>
                <COMPLEXITY ID="20" NAME="new name"/>
            </COMPLEXITIES>
            <EXAMS>
                <EXAM ID="10" NAME="new name"/>
                <EXAM ID="20" NAME="new name"/>
            </EXAMS>
            <REGIONS>
                <REGION ID="10" NAME="new name">
                    <REGIONS>
                        <REGION ID="10.10" NAME="new name">
                            <REGIONS>
                                <REGION ID="10.10.10" NAME="new name">
                                    <REGIONS>
                                        <REGION ID="10.10.10.10" NAME="new name"/>
                                    </REGIONS>
                                </REGION>
                            </REGIONS>
                        </REGION>
                    </REGIONS>
                </REGION>
            </REGIONS>
        </METADATA>
    </data>
</response>

 

Code Snippet

 

/* Check API Call for detail */

Map<String, String> parameters = new HashMap<String, String>();
populateMap(parameters);
String result = connection.invokeApi("metadataService.do", "adminusername", parameters);
System.out.println(result);
 
private void populateMap(Map<String, String> parameters) {
    parameters.put("dispatch", "getSiteMetadata");
}

Rating: