From d6b0549b34dc9676085772175c46a4c77284d183 Mon Sep 17 00:00:00 2001 From: Vladimir Oplustil Date: Mon, 8 Apr 2024 13:02:31 +0200 Subject: [PATCH] CTC-2412 - Add access to published content in MAPI --- .../cm_api_v2_get_published_variant.cs | 17 +++++++++++++++++ .../cm_api_v2_get_published_variant.curl | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 net/management-api-v2/cm_api_v2_get_published_variant.cs create mode 100644 rest/management-api-v2/cm_api_v2_get_published_variant.curl diff --git a/net/management-api-v2/cm_api_v2_get_published_variant.cs b/net/management-api-v2/cm_api_v2_get_published_variant.cs new file mode 100644 index 00000000..1fceda30 --- /dev/null +++ b/net/management-api-v2/cm_api_v2_get_published_variant.cs @@ -0,0 +1,17 @@ +// Tip: Find more about .NET SDKs at https://kontent.ai/learn/net +using Kontent.Ai.Management; + +var client = new ManagementClient(new ManagementOptions +{ + ApiKey = "", + ProjectId = "" +}); + +var identifier = new LanguageVariantIdentifier(Reference.ById(Guid.Parse("f4b3fc05-e988-4dae-9ac1-a94aba566474")), Reference.ById(Guid.Parse("d1f95fde-af02-b3b5-bd9e-f232311ccab8"))); +// var identifier = new LanguageVariantIdentifier(Reference.ById(Guid.Parse("f4b3fc05-e988-4dae-9ac1-a94aba566474")), Reference.ByCodename("es-ES")); +// var identifier = new LanguageVariantIdentifier(Reference.ByCodename("on_roasts"), Reference.ById(Guid.Parse("d1f95fde-af02-b3b5-bd9e-f232311ccab8"))); +// var identifier = new LanguageVariantIdentifier(Reference.ByCodename("on_roasts"), Reference.ByCodename("es-ES")); +// var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("59713"), Reference.ById(Guid.Parse("d1f95fde-af02-b3b5-bd9e-f232311ccab8"))); +// var identifier = new LanguageVariantIdentifier(Reference.ByExternalId("59713"), Reference.ByCodename("es-ES")); + +var response = await client.GetPublishedLanguageVariantAsync(identifier); \ No newline at end of file diff --git a/rest/management-api-v2/cm_api_v2_get_published_variant.curl b/rest/management-api-v2/cm_api_v2_get_published_variant.curl new file mode 100644 index 00000000..5d311646 --- /dev/null +++ b/rest/management-api-v2/cm_api_v2_get_published_variant.curl @@ -0,0 +1,9 @@ +curl --request GET \ + --url https://manage.kontent.ai/v2/projects//items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \ +# --url https://manage.kontent.ai/v2/projects//items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/published \ +# --url https://manage.kontent.ai/v2/projects//items/codename/my_article/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \ +# --url https://manage.kontent.ai/v2/projects//items/codename/my_article/variants/codename/es-ES/published \ +# --url https://manage.kontent.ai/v2/projects//items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \ +# --url https://manage.kontent.ai/v2/projects//items/external-id/59713/variants/codename/es-ES/published \ + --header 'Authorization: Bearer ' \ + --header 'Content-type: application/json' \ No newline at end of file