Request

Response

    Support for Localization

    The Manufacturing Data Model API supports the ability to specify localized content for specific fields. When you specify the locale and language that you want the response to be in, the values for those fields will be returned in the specified language. This feature currently works with the following objects only:

    How localization works

    Consider the following PropertyDefinitionCollection object. This object has a localizations field. This field contains an array of all the translations supported by the PropertyDefinitionCollection object. Each item in the array includes:

    • locale: The language/region code (like “en”, “de”, or “zh-CN”)
    • localizedFields: An array of translated field values. Each item in localizedFields contains:

      • localizedFields.name: The field being translated for display purposes.

        Note: In the following example, the value name specified for localizedFields.name maps to the localizedName field, which is the human-readable, translatable name for display purposes. It does not map to the name field that appears in the line above localizedName. This field (name) acts as a unique identifier and hence cannot be modified.

      • localizedFields.value: The translated text for that field
     {
         "id": "cHJvcGRlZmNvbH5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflUzVnRiV0Z5ZVE",
         "name": "Summary",
         "localizedName": "Summary",
         "description": "Summary Base Property Definitions",
         "localizations": [
             {
                 "locale": "en",
                 "localizedFields": [
                     {
                         "name": "name",
                         "value": "Summary"
                     },
                     {
                         "name": "description",
                         "value": "Summary Base Property Definitions"
                     }
                 ]
             },
             {
                 "locale": "cs",
                 "localizedFields": [
                     {
                         "name": "name",
                         "value": "Souhrn"
                     },
                     {
                         "name": "description",
                         "value": "Souhrn – definice základní vlastnosti"
                     }
                 ]
             },
             {
                 "locale": "de",
                 "localizedFields": [
                     {
                         "name": "name",
                         "value": "Zusammenfassung"
                     },
                     {
                         "name": "description",
                         "value": "Basiseigenschaftsdefinitionen für Zusammenfassung"
                     }
                 ]
             },
             // Additional languages: es, fr, it, ja, ko, pl, pt-BR, ru, tr...
             {
                 "locale": "zh-CN",
                 "localizedFields": [
                     {
                         "name": "name",
                         "value": "摘要"
                     },
                     {
                         "name": "description",
                         "value": "摘要基础特性定义"
                     }
                 ]
             },
             {
                 "locale": "zh-TW",
                 "localizedFields": [
                     {
                         "name": "name",
                         "value": "摘要"
                     },
                     {
                         "name": "description",
                         "value": "摘要基本性質定義"
                     }
                 ]
             }
         ]
     }
    
    Show More

    When you send a query with the Accept-Language header set to a locale, the API returns the localizedName and localizedDescription field values in the specified language.

    The following example illustrates the use of the Accept-Language header. When set to de-DE, the localizedName field returns “Zusammenfassung” (German) instead of “Summary” (English). The localizedDescription field returns “Basiseigenschaftsdefinitionen für Zusammenfassung” (German) instead of “Summary Base Property Definitions” (English).

    Example 1: Using the Accept-Language header with base properties

    Query:

    query GetHubs {
      hubs {
        pagination {
          cursor
          pageSize
        }
        results {
          id
          name
          alternativeIdentifiers {
            dataManagementAPIHubId
          }
          basePropertyDefinitionCollections {
            results {
              id
              name
              localizedName
              description
              localizedDescription
              localizations {
                locale
                localizedFields {
                  name
                  value
                }
              }
            }
          }
        }
      }
    }
    
    Show More

    Headers:

    -H 'Accept-Language: de-DE' \
    

    Response:

    {
        "data": {
            "hubs": {
                "pagination": {
                    "cursor": null,
                    "pageSize": 4
                },
                "results": [
                    {
                        "id": "urn:adsk.ace:beta.scope:0db4f57c-eeae-4fb3-a4d5-1831d9820ae2",
                        "name": "STG-TestHub",
                        "alternativeIdentifiers": {
                            "dataManagementAPIHubId": "a.YnVzaW5lc3M6YXV0b2Rlc2szMDEw"
                        },
                        "basePropertyDefinitionCollections": {
                            "results": [
                                {
                                    "id": "cHJvcGRlZmNvbH5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflUzVnRiV0Z5ZVE",
                                    "name": "Summary",
                                    "localizedName": "Zusammenfassung",
                                    "description": "Summary Base Property Definitions",
                                    "localizedDescription": "Basiseigenschaftsdefinitionen für Zusammenfassung",
                                    "localizations": [
                                        {
                                            "locale": "en",
                                            "localizedFields": [
                                                {
                                                    "name": "name",
                                                    "value": "Summary"
                                                },
                                                {
                                                    "name": "description",
                                                    "value": "Summary Base Property Definitions"
                                                }
                                            ]
                                        },
                                        {
                                            "locale": "de",
                                            "localizedFields": [
                                                {
                                                    "name": "name",
                                                    "value": "Zusammenfassung"
                                                },
                                                {
                                                    "name": "description",
                                                    "value": "Basiseigenschaftsdefinitionen für Zusammenfassung"
                                                }
                                            ]
                                        },
                                        // Additional languages: es, it, ja, ko, pl, pt-BR, ru, tr...
                                        {
                                            "locale": "fr",
                                            "localizedFields": [
                                                {
                                                    "name": "name",
                                                    "value": "Récapitulatif"
                                                },
                                                {
                                                    "name": "description",
                                                    "value": "Définitions des propriétés de base de Récapitulatif"
                                                }
                                            ]
                                        }
                                    ]
                                }
                                // Additional properties
                            ]
                        }
                    }
                ]
            }
        },
        "extensions": {
            "pointValue": {
                "requestedQueryPointValue": 651
            }
        }
    }
    
    Show More

    Example 2: Using the Accept-Language header with custom properties

    Query:

    query GetCurrentApplication($filter: PropertyDefinitionCollectionFilterInput) {
        application {
            id
            name
            propertyDefinitionCollections(filter: $filter) {
                results {
                    id
                    name
                    localizedName
                    description
                    localizedDescription
                    localizations {
                        locale
                        localizedFields {
                            name
                            value
                        }
                    }
                }
            }
        }
    }
    
    Show More

    Filter

    {
        "filter": {
            "id": "cHJvcGRlZmNvbH5BODQ4SWs4SU5FdzZHd3QzTWYyV0R1VVVxRnh6bWtNOGpCOGMzR1E5U2MxR3ZzVkx-QTg0OElrOElORXc2R3d0M01mMldEdVVVcUZ4em1rTThqQjhjM0dROVNjMUd2c1ZMfkxvY2FsaXplZENvbGxlY3Rpb24"
        }
    }
    

    Headers:

    -H 'Accept-Language: fr' \
    

    Response:

    {
        "data": {
            "application": {
                "id": "DGEEg6ocFR9o1i73ULFp9z1MrttGaEnE96UTDu7EQXc153Ld",
                "name": "nodejs-test-app",
                "propertyDefinitionCollections": {
                    "results": [
                        {
                            "id": "cHJvcGRlZmNvbH5BODQ4SWs4SU5FdzZHd3QzTWYyV0R1VVVxRnh6bWtNOGpCOGMzR1E5U2MxR3ZzVkx-QTg0OElrOElORXc2R3d0M01mMldEdVVVcUZ4em1rTThqQjhjM0dROVNjMUd2c1ZMfkxvY2FsaXplZENvbGxlY3Rpb24",
                            "name": "LocalizedCollection",
                            "localizedName": "Collection locale",
                            "description": "Collection for Localization",
                            "localizedDescription": "Collection pour les paramètres régionaux",
                            "localizations": [
                                {
                                    "locale": "fr",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Collection locale"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Collection pour les paramètres régionaux"
                                        }
                                    ]
                                },
                                {
                                    "locale": "es",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Materiales de Ingeniería 1"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Colección de materiales de ingeniería y sus propiedades"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        },
        "extensions": {
            "pointValue": {
                "requestedQueryPointValue": 133
            }
        }
    }
    
    Show More

    The PropertyDefinition object works the same way. It supports localized content using the same structure.

    You can see the complete list of supported languages in the GraphQL Endpoint documentation.

    Exceptions

    The following mutations do not honor the Accept-Language header:

    1. archivePropertyDefinition
    2. createPropertyDefinitionCollection
    3. createPropertyDefinitions
    4. updatePropertyDefinition
    5. updatePropertyDefinitionCollection

    An alternate way to access localized content

    You can also set a filter to get localized content for a specific language as an alternative to using the Accept-Language header.

    Example 3: Using a filter

    Query:

    query GetHub($hubId: ID! $filter: LocalesFilterInput) {
        hub (hubId: $hubId) {
            id
            name
            alternativeIdentifiers {
                dataManagementAPIHubId
            }
            basePropertyDefinitionCollections {
                results {
                    id
                    name
                    description
                    localizations (filter: $filter) {
                        locale
                        localizedFields {
                            name
                            value
                        }
                    }
                }
            }
        }
    }
    
    Show More

    QueryVariables:

    {
        "hubId": "urn:adsk.ace:beta.scope:0db4f57c-eeae-4fb3-a4d5-1831d9820ae2",
        "filter": {
            "locales": ["en", "fr"]
        }
    }
    

    Response:

    {
        "data": {
            "hub": {
                "id": "urn:adsk.ace:beta.scope:0db4f57c-eeae-4fb3-a4d5-1831d9820ae2",
                "name": "STG-TestHub",
                "alternativeIdentifiers": {
                    "dataManagementAPIHubId": "a.YnVzaW5lc3M6YXV0b2Rlc2szMDEw"
                },
                "basePropertyDefinitionCollections": {
                    "results": [
                        {
                            "id": "cHJvcGRlZmNvbH5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflVISnZhbVZqZEE",
                            "name": "Project",
                            "description": "Project Base Property Definitions",
                            "localizations": [
                                {
                                    "locale": "en",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Project"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Project Base Property Definitions"
                                        }
                                    ]
                                },
                                {
                                    "locale": "fr",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Projet"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Définitions des propriétés de base de Projet"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "id": "cHJvcGRlZmNvbH5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflUzVnRiV0Z5ZVE",
                            "name": "Summary",
                            "description": "Summary Base Property Definitions",
                            "localizations": [
                                {
                                    "locale": "en",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Summary"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Summary Base Property Definitions"
                                        }
                                    ]
                                },
                                {
                                    "locale": "fr",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Récapitulatif"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Définitions des propriétés de base de Récapitulatif"
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "id": "cHJvcGRlZmNvbH5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflEyOXRjRzl1Wlc1MA",
                            "name": "Component",
                            "description": "Component Base Property Definitions",
                            "localizations": [
                                {
                                    "locale": "en",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Component"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Component Base Property Definitions"
                                        }
                                    ]
                                },
                                {
                                    "locale": "fr",
                                    "localizedFields": [
                                        {
                                            "name": "name",
                                            "value": "Composant"
                                        },
                                        {
                                            "name": "description",
                                            "value": "Définitions des propriétés de base de Composant"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        },
        "extensions": {
            "pointValue": {
                "requestedQueryPointValue": 74
            }
        }
    }
    
    Show More

    How to specify localization content

    IMPORTANT: Localization content for base properties is locked and cannot be modified. You can only modify localization content for custom properties.

    You specify localization content for custom properties using the updatePropertyDefinitionLocalization and UpdatePropertyDefinitionCollectionLocalization mutations. These mutations allow you to update the localization content for property definitions and property definition collections, respectively.

    Example 4: Using the UpdatePropertyDefinitionCollectionLocalization mutation

    Query:

    mutation UpdatePropertyDefinitionCollectionLocalization($input: UpdateLocalizationInput!, $filter: LocalesFilterInput) {
        updatePropertyDefinitionCollectionLocalization(input: $input) {
            description
            id
            localizedName
            localizations(filter: $filter) {
                localizedFields {
                    value
                    name
                }
                locale
            }
        }
    }
    
    Show More

    Query Variables:

    {
        "input": {
            "id": "cHJvcGRlZmNvbH42WlEwRHNucHhBTW1LdUNkZm14VlNvYlB2azBUdEFzbH42WlEwRHNucHhBTW1LdUNkZm14VlNvYlB2azBUdEFzbH5Mb2NhbGl6ZWRDb2xsZWN0aW9u",
            "localizations": [
                {
                    "name": "Nom",
                    "locale": "fr",
                    "description": "Nom Description"
                }
            ]
        },
        "filter": {
            "locales": [
                "en",
                "fr"
            ]
        }
    }
    
    Show More

    Response:

    {
        "data": {
            "updatePropertyDefinitionCollectionLocalization": {
                "description": "Collection for Localization",
                "id": "cHJvcGRlZmNvbH42WlEwRHNucHhBTW1LdUNkZm14VlNvYlB2azBUdEFzbH42WlEwRHNucHhBTW1LdUNkZm14VlNvYlB2azBUdEFzbH5Mb2NhbGl6ZWRDb2xsZWN0aW9u",
                "localizedName": "LocalizedCollection",
                "localizations": [
                    {
                        "localizedFields": [
                            {
                                "value": "Nom",
                                "name": "name"
                            },
                            {
                                "value": "Nom Description",
                                "name": "description"
                            }
                        ],
                        "locale": "fr"
                    }
                ]
            }
        },
        "extensions": {
            "pointValue": {
                "requestedQueryPointValue": 16
            }
        }
    }
    
    Show More

    Best practices

    • Always check the localizations array for complete translation coverage
    • Use appropriate language codes that match your user’s locale preferences
    • Consider fallback logic for languages that may not have complete translations
    • Test with different Accept-Language values to ensure proper localization behavior