Skip to content

Latest commit

 

History

History
144 lines (104 loc) · 4.54 KB

contenttype-addcopy.md

File metadata and controls

144 lines (104 loc) · 4.54 KB
author title description ms.localizationpriority doc_type ms.subservice
swapnil1993
contentType: addCopy
Add a copy of a site content type to a list.
medium
apiPageType
sharepoint

contentType: addCopy

Namespace: microsoft.graph

Add a copy of a content type from a site to a list.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

POST /sites/{site-id}/lists/{list-id}/contentTypes/addCopy

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
contentType string Canonical URL to the site content type that will be copied to the list. Required.

Response

If successful, this call returns a 201 Created response code and a contentType object in the response body.

Example

Request

POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/contentTypes/addCopy
Content-Type: application/json

{
  "contentType": "https://graph.microsoft.com/v1.0/sites/{site-id}/contentTypes/0x0101"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

HTTP/1.1 201 Created

{
    "id": "0x0101",
    "description": "Create a new custom CSR JavaScript Display Template.",
    "group": "Display Template Content Types",
    "hidden": false,
    "name": "JavaScript Display Template",
    "parentId": "0x01",
    "readOnly": false,
    "sealed": false,
    "base": {
        "id": "0x01",
        "description": "Create a new custom CSR JavaScript Display Template.",
        "group": "Display Template Content Types",
        "hidden": false,
        "name": "JavaScript Display Template",
        "readOnly": false,
        "sealed": false
    }
}