Update applePushNotificationCertificate
Article
01/27/2024
11 contributors
Feedback
In this article
Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Update the properties of a applePushNotificationCertificate object.
This API is available in the following national cloud deployments .
Global service
US Government L4
US Government L5 (DOD)
China operated by 21Vianet
✅
✅
✅
✅
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)
DeviceManagementServiceConfig.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
DeviceManagementServiceConfig.ReadWrite.All
HTTP Request
PATCH /deviceManagement/applePushNotificationCertificate
Request body
In the request body, supply a JSON representation for the applePushNotificationCertificate object.
The following table shows the properties that are required when you create the applePushNotificationCertificate .
Property
Type
Description
id
String
Unique Identifier for the certificate
appleIdentifier
String
Apple Id of the account used to create the MDM push certificate.
topicIdentifier
String
Topic Id.
lastModifiedDateTime
DateTimeOffset
Last modified date and time for Apple push notification certificate.
expirationDateTime
DateTimeOffset
The expiration date and time for Apple push notification certificate.
certificateUploadStatus
String
The certificate upload status.
certificateUploadFailureReason
String
The reason the certificate upload failed.
certificateSerialNumber
String
Certificate serial number. This property is read-only.
certificate
String
Not yet documented
Response
If successful, this method returns a 200 OK
response code and an updated applePushNotificationCertificate object in the response body.
Example
Request
Here is an example of the request.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/applePushNotificationCertificate
Content-type: application/json
Content-length: 481
{
"@odata.type": "#microsoft.graph.applePushNotificationCertificate",
"appleIdentifier": "Apple Identifier value",
"topicIdentifier": "Topic Identifier value",
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00",
"certificateUploadStatus": "Certificate Upload Status value",
"certificateUploadFailureReason": "Certificate Upload Failure Reason value",
"certificateSerialNumber": "Certificate Serial Number value",
"certificate": "Certificate value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ApplePushNotificationCertificate
{
OdataType = "#microsoft.graph.applePushNotificationCertificate",
AppleIdentifier = "Apple Identifier value",
TopicIdentifier = "Topic Identifier value",
ExpirationDateTime = DateTimeOffset.Parse("2016-12-31T23:57:57.2481234-08:00"),
CertificateUploadStatus = "Certificate Upload Status value",
CertificateUploadFailureReason = "Certificate Upload Failure Reason value",
CertificateSerialNumber = "Certificate Serial Number value",
Certificate = "Certificate value",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.ApplePushNotificationCertificate.PatchAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management apple-push-notification-certificate patch --body '{\
"@odata.type": "#microsoft.graph.applePushNotificationCertificate",\
"appleIdentifier": "Apple Identifier value",\
"topicIdentifier": "Topic Identifier value",\
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00",\
"certificateUploadStatus": "Certificate Upload Status value",\
"certificateUploadFailureReason": "Certificate Upload Failure Reason value",\
"certificateSerialNumber": "Certificate Serial Number value",\
"certificate": "Certificate value"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewApplePushNotificationCertificate()
appleIdentifier := "Apple Identifier value"
requestBody.SetAppleIdentifier(&appleIdentifier)
topicIdentifier := "Topic Identifier value"
requestBody.SetTopicIdentifier(&topicIdentifier)
expirationDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:57.2481234-08:00")
requestBody.SetExpirationDateTime(&expirationDateTime)
certificateUploadStatus := "Certificate Upload Status value"
requestBody.SetCertificateUploadStatus(&certificateUploadStatus)
certificateUploadFailureReason := "Certificate Upload Failure Reason value"
requestBody.SetCertificateUploadFailureReason(&certificateUploadFailureReason)
certificateSerialNumber := "Certificate Serial Number value"
requestBody.SetCertificateSerialNumber(&certificateSerialNumber)
certificate := "Certificate value"
requestBody.SetCertificate(&certificate)
applePushNotificationCertificate, err := graphClient.DeviceManagement().ApplePushNotificationCertificate().Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
ApplePushNotificationCertificate applePushNotificationCertificate = new ApplePushNotificationCertificate();
applePushNotificationCertificate.setOdataType("#microsoft.graph.applePushNotificationCertificate");
applePushNotificationCertificate.setAppleIdentifier("Apple Identifier value");
applePushNotificationCertificate.setTopicIdentifier("Topic Identifier value");
OffsetDateTime expirationDateTime = OffsetDateTime.parse("2016-12-31T23:57:57.2481234-08:00");
applePushNotificationCertificate.setExpirationDateTime(expirationDateTime);
applePushNotificationCertificate.setCertificateUploadStatus("Certificate Upload Status value");
applePushNotificationCertificate.setCertificateUploadFailureReason("Certificate Upload Failure Reason value");
applePushNotificationCertificate.setCertificateSerialNumber("Certificate Serial Number value");
applePushNotificationCertificate.setCertificate("Certificate value");
ApplePushNotificationCertificate result = graphClient.deviceManagement().applePushNotificationCertificate().patch(applePushNotificationCertificate);
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);
const applePushNotificationCertificate = {
'@odata.type': '#microsoft.graph.applePushNotificationCertificate',
appleIdentifier: 'Apple Identifier value',
topicIdentifier: 'Topic Identifier value',
expirationDateTime: '2016-12-31T23:57:57.2481234-08:00',
certificateUploadStatus: 'Certificate Upload Status value',
certificateUploadFailureReason: 'Certificate Upload Failure Reason value',
certificateSerialNumber: 'Certificate Serial Number value',
certificate: 'Certificate value'
};
await client.api('/deviceManagement/applePushNotificationCertificate')
.update(applePushNotificationCertificate);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ApplePushNotificationCertificate;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ApplePushNotificationCertificate();
$requestBody->setOdataType('#microsoft.graph.applePushNotificationCertificate');
$requestBody->setAppleIdentifier('Apple Identifier value');
$requestBody->setTopicIdentifier('Topic Identifier value');
$requestBody->setExpirationDateTime(new \DateTime('2016-12-31T23:57:57.2481234-08:00'));
$requestBody->setCertificateUploadStatus('Certificate Upload Status value');
$requestBody->setCertificateUploadFailureReason('Certificate Upload Failure Reason value');
$requestBody->setCertificateSerialNumber('Certificate Serial Number value');
$requestBody->setCertificate('Certificate value');
$result = $graphServiceClient->deviceManagement()->applePushNotificationCertificate()->patch($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.applePushNotificationCertificate"
appleIdentifier = "Apple Identifier value"
topicIdentifier = "Topic Identifier value"
expirationDateTime = [System.DateTime]::Parse("2016-12-31T23:57:57.2481234-08:00")
certificateUploadStatus = "Certificate Upload Status value"
certificateUploadFailureReason = "Certificate Upload Failure Reason value"
certificateSerialNumber = "Certificate Serial Number value"
certificate = "Certificate value"
}
Update-MgDeviceManagementApplePushNotificationCertificate -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
from msgraph import GraphServiceClient
from msgraph.generated.models.apple_push_notification_certificate import ApplePushNotificationCertificate
graph_client = GraphServiceClient(credentials, scopes)
request_body = ApplePushNotificationCertificate(
odata_type = "#microsoft.graph.applePushNotificationCertificate",
apple_identifier = "Apple Identifier value",
topic_identifier = "Topic Identifier value",
expiration_date_time = "2016-12-31T23:57:57.2481234-08:00",
certificate_upload_status = "Certificate Upload Status value",
certificate_upload_failure_reason = "Certificate Upload Failure Reason value",
certificate_serial_number = "Certificate Serial Number value",
certificate = "Certificate value",
)
result = await graph_client.device_management.apple_push_notification_certificate.patch(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 594
{
"@odata.type": "#microsoft.graph.applePushNotificationCertificate",
"id": "c4c8f047-f047-c4c8-47f0-c8c447f0c8c4",
"appleIdentifier": "Apple Identifier value",
"topicIdentifier": "Topic Identifier value",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00",
"certificateUploadStatus": "Certificate Upload Status value",
"certificateUploadFailureReason": "Certificate Upload Failure Reason value",
"certificateSerialNumber": "Certificate Serial Number value",
"certificate": "Certificate value"
}