Closed Domitnator closed 1 year ago
This is a correct behavior from the API's point of view as you cannot set external_id to already existing items:
(https://kontent.ai/learn/reference/openapi/management-api-v2/#operation/add-a-content-item)
Hello @Domitnator,
thanks for reaching out. As @Enngage wrote, the inability to update the External ID is on the API, so we can't really do anything more. If you want to request the feature directly to the product, feel free to do so via Intercom (easiest it from the Roadmap page, or via Feedback portal).
I am more curious about your use case. What are you trying to achieve by syncing the system ID and External ID? My hunch says it might be connected with environments and the inability of MAPI API to get the External ID/codename as an identification in responses.
Hi @Simply007
Thanks for your answer! It felt like a bug but as @Enngage pointed out, it is documented in the documentation! So i should have read more carefully haha.
About the use case:
So there needs to be a connection between some of the FAQ-items, that's why we use the ExternalID. For newly created FAQ-items (created in the secure project) this works perfecly. When the webhook is triggered i can check if the public faq-item already exists (based on the externalID), if yes then update the item..otherwise, create the item.
But those 200 which already exist in the public project i cannot retrieve by the externalID, therefor i wanted to update the externalID. So as a fallback i try to retrieve it by the codename (but then the codename in the public and secure project always need to be the same, which can be tricky).
I hope my usecase is clear? Otherwise feel free to contact me!
Thank you for the sum up. As I said this is the API limitation currently and feel free to submit feedback to get this attention from the product. I will try to pass the scenario as well.
But I am afraid there is not much we can do without changing the identification mechanism drastically in the product. To give you a bit of context the External ID is tightly bound to System.ID. The main use case is to ensure consistency but allows to import of circular dependencies, or not to care whether some dependent entities being imported first - https://kontent.ai/learn/tutorials/set-up-kontent-ai/import-content/linked-content/#a-2-use-external-ids-to-reference-items
Unfortunately, I can offer you not a straightforward workaround from the SDK/API offering point of view.
There is a unification scenario
And then the OLD FAQ migration to their clones (which might be easy if you are not linking the FAQs from many places)
Brief bug description
I am retrieving an existing item, then set the externalID and then upsert the content item but the externalID is null after the upsert
Repro steps
After the upsertContentItemAsync the cim.ExternalId is null. Also i am not able to retrieve it by its external id:
Expected behavior
After calling the UpsertContentItemAsync the externalID should be set.
Test environment
Additional context
Add any other context about the problem here.
Screenshots
Before UpsertContentItemAsync:
Aftter UpsertContentItemAsync: