APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
If a 207 response is returned, this indicates that only some of the added externalActivity instances were successfully processed. The caller should inspect the response payload, looking at the error field for each externalActivityResult to determine why the externalActivity instance was not processed and what action can be taken. If the error field is null, that indicates a successful externalActivityResult.
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Connections.Item.Items.Item.ExternalConnectorsAddActivities.AddActivitiesPostRequestBody
{
Activities = new List<Microsoft.Graph.Beta.Models.ExternalConnectors.ExternalActivity>
{
new Microsoft.Graph.Beta.Models.ExternalConnectors.ExternalActivity
{
OdataType = "#microsoft.graph.externalConnectors.externalActivity",
Type = Microsoft.Graph.Beta.Models.ExternalConnectors.ExternalActivityType.Viewed,
StartDateTime = DateTimeOffset.Parse("String (timestamp)"),
},
},
};
var result = await graphClient.Connections["{externalConnection-id}"].Items["{externalItem-id}"].ExternalConnectorsAddActivities.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewAddActivitiesPostRequestBody()
externalActivity := graphmodels.NewExternalActivity()
type := graphmodels.STRING_EXTERNALACTIVITYTYPE
externalActivity.SetType(&type)
startDateTime , err := time.Parse(time.RFC3339, "String (timestamp)")
externalActivity.SetStartDateTime(&startDateTime)
activities := []graphmodels.ExternalActivityable {
externalActivity,
}
requestBody.SetActivities(activities)
result, err := graphClient.ConnectionsById("externalConnection-id").ItemsById("externalItem-id").ExternalConnectorsAddActivities().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new AddActivitiesPostRequestBody();
$activitiesExternalActivity1 = new ExternalActivity();
$activitiesExternalActivity1->set@odatatype('#microsoft.graph.externalConnectors.externalActivity');
$activitiesExternalActivity1->setType(new ExternalActivityType('string'));
$activitiesExternalActivity1->setStartDateTime(new DateTime('String (timestamp)'));
$activitiesArray []= $activitiesExternalActivity1;
$requestBody->setActivities($activitiesArray);
$requestResult = $graphServiceClient->connectionsById('externalConnection-id')->itemsById('externalItem-id')->externalConnectorsAddActivities()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.