Create externalItem

Namespace: microsoft.graph.externalConnectors

Create a new externalItem 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

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ExternalItem.ReadWrite.OwnedBy ExternalItem.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application ExternalItem.ReadWrite.OwnedBy ExternalItem.ReadWrite.All

HTTP request

PUT /external/connections/{connection-id}/items/{item-id}

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 externalItem object.

You can specify the following properties when creating an externalItem.

Property Type Description
id String The item ID. Required.
properties microsoft.graph.externalConnectors.properties The item properties. The properties object must contain at least one property. All DateTime type properties must be in ISO 8601 format. Required.
content microsoft.graph.externalConnectors.externalItemContent The external item content. Optional.
acl microsoft.graph.externalConnectors.acl collection The access control list. Required.

Properties on an externalItem should use type specifiers in the payload in the following scenarios:

  • For String type properties, if the value contains non-ASCII characters.

    "description@odata.type": "String",
    "description": "Kandierte Äpfel"
    
  • For all collection types.

    "categories@odata.type": "Collection(String)"
    "categories": [
      "red",
      "blue"
    ]
    

    Important

    When including a property of type Collection(DateTime), you must use the type specifier Collection(DateTimeOffset).

Response

If successful, this method returns 200 OK response code.

Examples

Example: Create a custom item

Request

PUT https://graph.microsoft.com/v1.0/external/connections/contosohr/items/TSP228082938
Content-type: application/json

{
  "acl": [
    {
      "type": "user",
      "value": "e811976d-83df-4cbd-8b9b-5215b18aa874",
      "accessType": "grant"
    },
    {
      "type": "externalGroup",
      "value": "14m1b9c38qe647f6a",
      "accessType": "deny"
    }
  ],
  "properties": {
    "title": "Error in the payment gateway",
    "priority": 1,
    "assignee": "john@contoso.com"
  },
  "content": {
    "value": "Error in payment gateway...",
    "type": "text"
  }
}

Response

The following example shows the response.

HTTP/1.1 200 OK