contentType: isPublished
Article
08/18/2022
2 minutes to read
6 contributors
Feedback
In this article
Namespace: microsoft.graph
Check the publishing status of a contentType in a content type hub site.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Sites.FullControl.All
Delegated (personal Microsoft account)
Not supported.
Application
Sites.FullControl.All
HTTP request
GET /sites/{siteId}/contentTypes/{contentTypeId}/isPublished
Note: The siteId represents a content type hub site.
Name
Description
Authorization
Bearer {token}. Required.
Response
If successful, this method returns a 200 OK
response code and a Boolean value that specifies the publishing status of the content type.
Request body
Do not supply a request body for this method.
Example
Request
The following is an example of a request.
GET https://graph.microsoft.com/v1.0/sites/{siteId}/contentTypes/{contentTypeId}/isPublished
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var boolean = await graphClient.Sites["{site-id}"].ContentTypes["{contentType-id}"]
.IsPublished()
.Request()
.GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
let _boolean = await client.api('/sites/{siteId}/contentTypes/{contentTypeId}/isPublished')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Boolean _boolean = graphClient.sites("{siteId}").contentTypes("{contentTypeId}")
.isPublished()
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
result, err := graphClient.SitesById("site-id").ContentTypesById("contentType-id").IsPublished().Get(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestResult = $graphServiceClient->sitesById('site-id')->contentTypesById('contentType-id')->isPublished()->get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following is an example of the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": true
}