externalItem: addActivities

Namespace: microsoft.graph.externalConnectors

Append additional instances of externalActivity objects on an externalItem.

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) Not supported.
Delegated (personal Microsoft account) Not supported.
Application ExternalItem.ReadWrite.OwnedBy, ExternalItem.ReadWrite.All

HTTP request

POST external/connections/{connectionsId}/items/{externalItemId}/addActivities

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the parameters.

The following table shows the parameters that can be used with this action.

Parameter Type Description
activities microsoft.graph.externalConnectors.externalActivity collection Collection of activities that involve an externalItem.

Response

If successful, this action returns a 200 OK response code and a collection of microsoft.graph.externalConnectors.externalActivityResult objects in the response body.

A 207 Multi-Status response code 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. A null error property indicates a successful externalActivityResult.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/external/connections/contosohr/items/TSP228082938/addActivities
Content-Type: application/json
Content-length: 190

{
  "activities": [
    {
      "@odata.type": "#microsoft.graph.externalConnectors.externalActivity",
      "type": "created",
      "startDateTime": "2021-04-06T18:04:31.033Z",
      "performedBy": {
        "type": "user",
        "id": "1f0c997e-99f7-43f1-8cca-086f8d42be8d"
      }
    }
  ]
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.externalConnectors.externalActivityResult",
      "type": "created",
      "startDateTime": "2021-04-06T18:04:31.033Z",
      "error": null
    }
  ]
}