0

I am working on a connector with a Sitecore Content Hub environnement. I am using the REST API, sending POST request to create some Assets.

I wonder if there is a way to set a taxonomy relation with its identifier instead of the id ?

For example to set FinalLifeCycleStatusToAsset with M.Final.LifeCycle.Status.Approved instead of 544.

My request is a POST to https://{{hostname}}/api/entities/

With the following body :

{
    "properties":{
        "Title":"REST API Asset",
        "Description": {
            "en-US": "<p>Description</p>"
        }
    },
    "relations": {
        "FinalLifeCycleStatusToAsset": {
            "parent": {
                "href": "http://{{hostname}}/api/entities/544"
            }
        }
    },
    "entitydefinition":{
        "href":"http://{{hostname}}/api/entitydefinitions/M.Asset"
    }

}

I have tried to set href to http://{{hostname}}/api/entities/identifier/M.Final.LifeCycle.Status.Approved by it gives me in response this message : "Unable to match the route 'EntityById' template with the available route values."

To conclude, is it possible to use M.Final.LifeCycle.Status.Approved instead of 544 when created an asset ? And how can I do that ?

Thanks for your help,

0

After investigation and asking the question to Sitecore team. It seems not possible to use the identifier instead of the id in the REST API relations when creating an entity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.