Skip to main content Skip to complementary content

Update a data model with XSD

Availability-noteDeprecated

Updates a data model with the XSD (XML Schema Definition) provided in the request content as XML.

Information noteNote: Only the Super Admin type users with the administration role have access to this API. For more information about MDM user types, see MDM user types and system roles.
Request
PUT /services/rest/system/models/{model}
Parameters
  • model: This is a String value which represents the name of the data model whose XML schema you want to update.
  • force: This is a Boolean value which controls whether to update the data model with the new XSD when the change has an impact level of Medium or High. By default, it is false, which means the data model will not be updated when the change has an impact level of Medium or High.
Headers
  • Content-Type: application/xml or text/xml
    Information noteNote: If the XML declaration is included in the XML request content and the encoding attribute is used, you must set its value to UTF-8.
  • Authorization: Basic Authentication scheme
Response No content.
Status
  • 200 OK: The operation is executed successfully.
  • 401 UNAUTHORIZED: Login fails, invalid username or password.
  • 403 FORBIDDEN: Missing required permission.
  • 404 NOT FOUND: The resource does not exist, for example, invalid data model name.
  • 500 INTERNAL SERVER ERROR: Other errors, for example, incorrect schema.

Sample request

The following sample updates the data model Company in Get the XML schema of a data model by adding a new mandatory element Gender in the entity Employee.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
    <xsd:element name="Employee">
        <xsd:annotation>
            <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
            <xsd:appinfo source="X_Write">Company_User</xsd:appinfo>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:all>
                <xsd:element maxOccurs="1" minOccurs="1" name="Id" type="xsd:string">
                    <xsd:annotation>
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
                        <xsd:appinfo source="X_Write">Company_User</xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
                <xsd:element maxOccurs="1" minOccurs="1" name="Name" type="xsd:string">
                    <xsd:annotation>
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
                        <xsd:appinfo source="X_Write">Company_User</xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
                <xsd:element maxOccurs="1" minOccurs="1" name="Gender" type="xsd:string"> 
                    <xsd:annotation> 
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>  
                        <xsd:appinfo source="X_Write">Company_User</xsd:appinfo> 
                    </xsd:annotation> 
                </xsd:element> 
                <xsd:element maxOccurs="1" minOccurs="1" name="Team" type="xsd:string">
                    <xsd:annotation>
                        <xsd:appinfo source="X_ForeignKey">Team/Id</xsd:appinfo>
                        <xsd:appinfo source="X_ForeignKey_NotSep">true</xsd:appinfo>
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
                        <xsd:appinfo source="X_Write">Company_User</xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
            </xsd:all>
        </xsd:complexType>
        <xsd:unique name="Employee">
            <xsd:selector xpath="."/>
            <xsd:field xpath="Id"/>
        </xsd:unique>
    </xsd:element>
    <xsd:element name="Team">
        <xsd:annotation>
            <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:all>
                <xsd:element maxOccurs="1" minOccurs="1" name="Id" type="xsd:string">
                    <xsd:annotation>
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
                <xsd:element maxOccurs="1" minOccurs="1" name="Name" type="xsd:string">
                    <xsd:annotation>
                        <xsd:appinfo source="X_Write">Company_Manager</xsd:appinfo>
                    </xsd:annotation>
                </xsd:element>
            </xsd:all>
        </xsd:complexType>
        <xsd:unique name="Team">
            <xsd:selector xpath="."/>
            <xsd:field xpath="Id"/>
        </xsd:unique>
    </xsd:element>
</xsd:schema>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!