Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTC-2412 - Add access to published content in MAPI #84

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions net/management-api-v2/cm_api_v2_get_published_variant.cs
Original file line number Diff line number Diff line change
@@ -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 = "<YOUR_API_KEY>",
ProjectId = "<YOUR_ENVIRONMENT_ID>"
});

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);
9 changes: 9 additions & 0 deletions rest/management-api-v2/cm_api_v2_get_published_variant.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
curl --request GET \
--url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \
# --url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/published \
# --url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/codename/my_article/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \
# --url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/codename/my_article/variants/codename/es-ES/published \
# --url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/published \
# --url https://manage.kontent.ai/v2/projects/<YOUR_ENVIRONMENT_ID>/items/external-id/59713/variants/codename/es-ES/published \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-type: application/json'
Loading