Create externalItem

Namespace: microsoft.graph.externalConnectors

Important

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.

Create a new externalItem.

This API can be used to create a custom item. The containing externalConnection must have a schema registered of the corresponding type.

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}

Path parameters

Parameter Type Description
connection-id string The id property of the containing externalConnection
item-id string The developer-provided id property of the externalItem. If no item already exists with this id, a new item is created. If an item already exists with this id, it is overwritten by the object sent in the body.

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 an externalItem object. The payload is limited to 4 MB.

Creating an externalItem

When creating an externalItem, the following fields are required: acl, and properties. The properties object must contain at least one property.

All DateTime type properties must be in ISO 8601 format.

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

The following example shows a request.

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

{
  "acl": [
    {
      "type": "user",
      "value": "e811976d-83df-4cbd-8b9b-5215b18aa874",
      "accessType": "grant",
      "identitySource": "azureActiveDirectory"
    },
    {
      "type": "group",
      "value": "14m1b9c38qe647f6a",
      "accessType": "deny",
      "identitySource": "external"
    }
  ],
  "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