Muokkaa

Jaa


Update corsConfiguration_v2

Namespace: microsoft.graph

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.

Update the properties of a corsConfiguration_v2 object.

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 permission Higher privileged permissions
Delegated (work or school account) Not supported. Not supported.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Not supported. Not supported.

HTTP request

PATCH /applications/{applicationObjectId}/onPremisesPublishing/segmentsConfiguration/microsoft.graph.webSegmentConfiguration/applicationSegments/{applicationSegment-id}/corsConfigurations/{corsConfiguration_v2-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 only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.

The following table specifies the properties that can be updated.

Property Type Description
allowedHeaders String Collection The request headers that the origin domain may specify on the CORS request. The wildcard character * indicates that any header beginning with the specified prefix is allowed.
allowedMethods String Collection The HTTP request methods that the origin domain may use for a CORS request.
allowedOrigins String Collection The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request originates. The origin must be an exact case-sensitive match with the origin that the user agent sends to the service.
maxAgeInSeconds Integer The maximum amount of time that a browser should cache the response to the preflight OPTIONS request.
resource String Resource within the application segment for which CORS permissions are granted. / grants permission for the whole app segment.

Response

If successful, this method returns a 200 OK response code and an updated corsConfiguration_v2 object in the response body.

Examples

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/applications/{applicationObjectId}/onPremisesPublishing/segmentsConfiguration/microsoft.graph.webSegmentConfiguration/applicationSegments/{segmentid}/corsConfigurations/{id}
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.corsConfiguration_v2",
  "resource": "/",
  "allowedOrigins": [
    ""
  ],
  "allowedHeaders": [
    ""
  ],
  "allowedMethods": [
    ""
  ],
  "maxAgeInSeconds": 3000
}

Response

The following example shows the response.

HTTP/1.1 204 No Content