Skip to main content

Behaviors

GET Behaviors#

Gets the distribution behaviors.

GET ALL
MethodGET ALL
URL or EndPoint/api/v{version}/projects/{projectId}/distributions/{distributionId}/behaviors
HeadersAuthorization
ParametersdistributionId, projectId, version, PageIndex, PageSize
BodyNot Applicable

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{projectId}Yesstring($uuid)3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
{distributionId}Yesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
projectIdYesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty project configuration is returned
distributionIdYesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
VersionYesstring($uuid)v1Shows the version of API
PageIndexNointeger($int32)1How many pages
PageSizeNointeger($int32)2Paganed Data

Request Body#

The request does not have a request body.

Responses#

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in json format by the service.

{  "success": true,  "errors": [    "string"  ],  "messages": [    "string"  ],  "result": [    {      "id": 0,      "precedence": 0,      "pathPattern": "string",      "origin": "string",      "viewerProtocolPolicy": "string",      "cachePolicyName": "string",      "originRequestPolicyName": "string",      "trustedKeyGroups": "string",      "trustedSigners": "string"    }  ],  "resultInfo": {    "totalCount": 0,    "pageIndex": 0,    "pageSize": 0,    "totalPages": 0,    "hasNextPage": true,    "hasPreviousPage": true  }}
Field NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsarray []"string"Indicate if there was an error
messagesarray []"string"Returns the response message from back-end
resultarray [object]Returns a behavior object
idinteger($int32)"string"The identifier for the behavior
precedenceinteger($int32)0Changes the order of behavior's precedence
pathPatternstring"string"Returns pathPattern that you've specified in the configuration
originstring"string"Returns origin name that you've specified in the configuration
viewerProtocolPolicystring"string"Returns viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
cachePolicyNamestring"string"Returns the cache policy name that you choose in the dropdown list in the configuration of behavior
originRequestPolicyNamestring"string"Returns the origin request policy name that you choose in the dropdown list in the configuration of behavior
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns the previous page of paganed data

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code: 401 Unauthorized
  • HTTP Status Code: 403 Forbidden
  • HTTP Status Code: 404 Not found

POST Behaviors#

Creates a new behavior for the specified distribution.

POST
MethodPOST
URL or EndPoint/api/v{version}/projects/{projectId}/distributions/{distributionId}/behaviors
HeadersAuthorization
ParametersprojectId, distributionId, version
Body{id,distributionId,pathPattern, isOriginGroup, originId, viewerProtocolPolicy, allowedHttpMethods, cachedHttpMethods, compressObjectsAutomatically, useCacheAndOriginRequestPolicy, cachePolicyId, originRequestPolicyId, objectCaching, minimumTtl, maximumTtl, defaultTtl, forwardCookies, queryStringForwardingAndCaching}

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{projectId}Yesstring($uuid)3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
{distributionId}Yesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
projectIdYesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty project configuration is returned
distributionIdYesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
VersionYesstring($uuid)v1Shows the version of API

Request body#

{  "id": 0,  "distributionId": "string",  "pathPattern": "string",  "isOriginGroup": true,  "originId": 0,  "viewerProtocolPolicy": 0,  "allowedHttpMethods": 0,  "cachedHttpMethods": 0,  "compressObjectsAutomatically": true,  "cachePolicyId": 0,  "originRequestPolicyId": 0,
}

The description of the parameters is as follows:

Body Parameter NameMandatoryTypeExampleDescription
idYesinteger($int32)0The identifier for the behavior
distributionIdYesstring"string"The identifier for distribution
pathPatternYesstring"string"Sends path pattern that you've specified in the configuration
isOriginGroupYesbooltrueSends true if it is a origin group otherwise for the origin it returns false
originIdNointeger($int32)0The identifier of the origin
viewerProtocolPolicyYesinteger($int32)0Sends viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
allowedHttpMethodsYesinteger($int32)0Sends selected http methods in behavior configuration
cachedHttpMethodsYesinteger($int32)0Sends the http methods the user wants to cache for the cache behavior
compressObjectsAutomaticallyYesbooltrueSends true if it is compressed automatically, otherwise turns false
cachePolicyIdNointeger($int32)0Sends the identifier for the selected cache policy id
originRequestPolicyIdYesinteger($int32)0Sends the identifier for the selected origin request policy id

Responses#

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in json format by the service.

{  "success": true,  "errors": [    "string"  ],  "messages": [    "string"  ],  "result": {    "id": 0,    "distributionId": "string",    "pathPattern": "string",    "isOriginGroup": true,    "originId": 0,    "originOptions": [      {        "id": 0,        "value": "string"      }    ],    "originGroupOptions": [      {        "id": 0,        "value": "string"      }    ],    "viewerProtocolPolicy": 0,    "viewerProtocolPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "allowedHttpMethods": 0,    "allowedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "cachedHttpMethods": 0,    "cachedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "cachePolicyId": 0,    "cachePolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "originRequestPolicyId": 0,    "originRequestPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "objectCaching": true,    "minimumTtl": 0,    "maximumTtl": 0,    "defaultTtl": 0,    "forwardCookies": 0,    "forwardCookiesOptions": [      {        "id": 0,        "value": "string"      }    ],    "queryStringForwardingAndCaching": 0,    "queryStringForwardingAndCachingOptions": [      {        "id": 0,        "value": "string"      }    ],    "compressObjectsAutomatically": true  },  "resultInfo": {    "totalCount": 0,    "pageIndex": 0,    "pageSize": 0,    "totalPages": 0,    "hasNextPage": true,    "hasPreviousPage": true  }}
Field NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsstring"string"Indicate if there was an error
messagesstring"string"Returns the response message from back-end
resultarray [object]Returns a behavior object
idinteger($int32)0The identifier for the behavior
distributionIdstring"string"Returns the identifier of distribution in behaviors
pathPatternstring"string"Returns pathPattern that you've specified in the configuration
isOriginGroupbooltrueReturns true if it is a origin group otherwise for the origin it returns false
originIdinteger($int32)0Returns the identifier of the origin
originOptionsarray [object]Returns the selected origin options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin options in behaviors configuration
originGroupOptionsarray [object]0Returns the selected origin group options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin group
viewerProtocolPolicystring"string"Returns viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
viewerProtocolPolicyOptionsarray [object]Returns viewer protocol policy selected options in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected viewer protocol policy
allowedHttpMethodsinteger($int32)0Returns selected http methods in behavior configuration
allowedHttpMethodsOptionsarray [object]Returns an object of selected http methods in behavior configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected http method
cachedHttpMethodsinteger($int32)0Returns the http methods the user wants to cache for the cache behavior
cachedHttpMethodsOptionsarray [object]Returns an object of selected http method options the user wants to cache for the cache behavior
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cached http method
useCacheAndOriginRequestPolicybooltrueReturns the selected use a cache policy and origin request policy
cachePolicyIdinteger($int32)0Returns the user input of the cache policy identifier
cachePolicyOptionsarray [object]Returns an object of cache policy options which is "Disabled", "Optimized" or "Custom"
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cache policy
originRequestPolicyIdinteger($int32)0
originRequestPolicyOptionsarray [object]
idinteger($int32)0The identifier for the behavior
valuestring"string"
compressObjectsAutomaticallybooltrueReturns true if object is compressed automatically otherwise it returns false
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns the previous page of paganed data

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code: 401 Unauthorized
  • HTTP Status Code: 403 Forbidden
  • HTTP Status Code: 404 Not found

GET Behavior#

Gets the distribution behavior with the specified id

GET
MethodGET By Id
URL or EndPoint/api/v{version}/projects/{projectId}/distributions/{distributionId}/behaviors/{id}
HeadersAuthorization
ParametersdistributionId, id, version, projectId
BodyNot Applicable

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{projectId}Yesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
{distributionId}Yesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
{id}Yesinteger($int32)0Shows the version of API

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
projectIdYesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
versionYesstringv1Shows the version of API
distributionIdYesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
idYesinteger($int32)0The behavior's ID.

Request Body#

The request does not have a request body.

Responses#

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in json format by the service.


{
  "success": true,  "errors": [    "string"  ],  "messages": [    "string"  ],  "result": {    "id": 0,    "distributionId": "string",    "pathPattern": "string",    "isOriginGroup": true,    "originId": 0,    "originOptions": [      {        "id": 0,        "value": "string"      }    ],    "originGroupOptions": [      {        "id": 0,        "value": "string"      }    ],    "viewerProtocolPolicy": 0,    "viewerProtocolPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "allowedHttpMethods": 0,    "allowedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "cachedHttpMethods": 0,    "cachedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "useCacheAndOriginRequestPolicy": true,    "cachePolicyId": 0,    "cachePolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "originRequestPolicyId": 0,    "originRequestPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "objectCaching": true,    "minimumTtl": 0,    "maximumTtl": 0,    "defaultTtl": 0,    "forwardCookies": 0,    "forwardCookiesOptions": [      {        "id": 0,        "value": "string"      }    ],    "queryStringForwardingAndCaching": 0,    "queryStringForwardingAndCachingOptions": [      {        "id": 0,        "value": "string"      }    ],    "compressObjectsAutomatically": true  },  "resultInfo": {    "totalCount": 0,    "pageIndex": 0,    "pageSize": 0,    "totalPages": 0,    "hasNextPage": true,    "hasPreviousPage": true  }}
Field NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsstring"string"Indicate if there was an error
messagesstring"string"Returns the response message from back-end
resultarray [object]Returns a behavior object
idinteger($int32)0The identifier for the behavior
distributionIdstring"string"Returns the identifier of distribution in behaviors
pathPatternstring"string"Returns pathPattern that you've specified in the configuration
isOriginGroupbooltrueReturns true if it is a origin group otherwise for the origin it returns false
originIdinteger($int32)0Returns the identifier of the origin
originOptionsarray [object]Returns the selected origin options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin options in behaviors configuration
originGroupOptionsarray [object]0Returns the selected origin group options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin group
viewerProtocolPolicystring"string"Returns viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
viewerProtocolPolicyOptionsarray [object]Returns viewer protocol policy selected options in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected viewer protocol policy
allowedHttpMethodsinteger($int32)0Returns selected http methods in behavior configuration
allowedHttpMethodsOptionsarray [object]Returns an object of selected http methods in behavior configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected http method
cachedHttpMethodsinteger($int32)0Returns the http methods the user wants to cache for the cache behavior
cachedHttpMethodsOptionsarray [object]Returns an object of selected http method options the user wants to cache for the cache behavior
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cached http method
useCacheAndOriginRequestPolicybooltrueReturns the selected use a cache policy and origin request policy
cachePolicyIdinteger($int32)0Returns the user input of the cache policy identifier
cachePolicyOptionsarray [object]Returns an object of cache policy options which is "Disabled", "Optimized" or "Custom"
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cache policy
originRequestPolicyIdinteger($int32)0
originRequestPolicyOptionsarray [object]
idinteger($int32)0The identifier for the behavior
valuestring"string"
compressObjectsAutomaticallybooltrueReturns true if object is compressed automatically otherwise it returns false
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns the previous page of paganed data

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code: 401 Unauthorized
  • HTTP Status Code: 403 Forbidden
  • HTTP Status Code: 404 Not found

PUT Behaviors#

Updates the specified behavior.

PUT
MethodPUT
URL or EndPoint/api/v{version}/projects/{projectId}/distributions/{distributionId}/behaviors/{id}
HeadersAuthorization
ParametersdistributionId, id, version, projectId
Body{id,distributionId,pathPattern, isOriginGroup, originId, viewerProtocolPolicy, allowedHttpMethods, cachedHttpMethods, compressObjectsAutomatically, useCacheAndOriginRequestPolicy, cachePolicyId, originRequestPolicyId, objectCaching, minimumTtl, maximumTtl, defaultTtl, forwardCookies, queryStringForwardingAndCaching}

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{projectId}Yesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
{distributionId}Yesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
{id}Yesinteger($int32)0Shows the version of API

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
projectIdYesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
versionYesstringv1Shows the version of API
distributionIdYesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
idYesinteger($int32)0The behavior's ID.

Request body#

{  "id": 0,  "distributionId": "string",  "pathPattern": "string",  "isOriginGroup": true,  "originId": 0,  "viewerProtocolPolicy": 0,  "allowedHttpMethods": 0,  "cachedHttpMethods": 0,  "compressObjectsAutomatically": true,  "useCacheAndOriginRequestPolicy": true,  "cachePolicyId": 0,  "originRequestPolicyId": 0,
}

The description of the parameters is as follows:

Body Parameter NameMandatoryTypeExampleDescription
idYesinteger($int32)0
distributionIdYesstring"string"The identifier for distribution
pathPatternYesstring"string"Sends path pattern that you've specified in the configuration
isOriginGroupYesbooltrueSends true if it is a origin group otherwise for the origin it returns false
originIdNointeger($int32)0The identifier of the origin
viewerProtocolPolicyYesinteger($int32)0Sends viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
allowedHttpMethodsYesinteger($int32)0Sends selected http methods in behavior configuration
cachedHttpMethodsYesinteger($int32)0Sends the http methods the user wants to cache for the cache behavior
compressObjectsAutomaticallyYesbooltrueSends true if it is compressed automatically, otherwise turns false
cachePolicyIdNointeger($int32)0Sends the identifier for the selected cache policy id
originRequestPolicyIdYesinteger($int32)0Sends the identifier for the selected origin request policy id

Responses#

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in json format by the service.



Success
Media type
text/plainControls Accept header.Example ValueSchema{"success": true,"errors": [  "string"],"messages": [  "string"],"result": {  "id": 0,  "distributionId": "string",  "pathPattern": "string",  "isOriginGroup": true,  "originId": 0,  "originOptions": [    {      "id": 0,      "value": "string"    }  ],  "originGroupOptions": [    {      "id": 0,      "value": "string"    }  ],  "viewerProtocolPolicy": 0,  "viewerProtocolPolicyOptions": [    {      "id": 0,      "value": "string"    }  ],  "allowedHttpMethods": 0,  "allowedHttpMethodsOptions": [    {      "id": 0,      "value": "string"    }  ],  "cachedHttpMethods": 0,  "cachedHttpMethodsOptions": [    {      "id": 0,      "value": "string"    }  ],  "useCacheAndOriginRequestPolicy": true,  "cachePolicyId": 0,  "cachePolicyOptions": [    {      "id": 0,      "value": "string"    }  ],  "originRequestPolicyId": 0,  "originRequestPolicyOptions": [    {      "id": 0,      "value": "string"    }  ],  "objectCaching": true,  "minimumTtl": 0,  "maximumTtl": 0,  "defaultTtl": 0,  "forwardCookies": 0,  "forwardCookiesOptions": [    {      "id": 0,      "value": "string"    }  ],  "queryStringForwardingAndCaching": 0,  "queryStringForwardingAndCachingOptions": [    {      "id": 0,      "value": "string"    }  ],  "compressObjectsAutomatically": true},"resultInfo": {  "totalCount": 0,  "pageIndex": 0,  "pageSize": 0,  "totalPages": 0,  "hasNextPage": true,  "hasPreviousPage": true}}
Field NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsstring"string"Indicate if there was an error
messagesstring"string"Returns the response message from back-end
resultarray [object]Returns a behavior object
idinteger($int32)0The identifier for the behavior
distributionIdstring"string"Returns the identifier of distribution in behaviors
pathPatternstring"string"Returns pathPattern that you've specified in the configuration
isOriginGroupbooltrueReturns true if it is a origin group otherwise for the origin it returns false
originIdinteger($int32)0Returns the identifier of the origin
originOptionsarray [object]Returns the selected origin options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin options in behaviors configuration
originGroupOptionsarray [object]0Returns the selected origin group options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin group
viewerProtocolPolicystring"string"Returns viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
viewerProtocolPolicyOptionsarray [object]Returns viewer protocol policy selected options in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected viewer protocol policy
allowedHttpMethodsinteger($int32)0Returns selected http methods in behavior configuration
allowedHttpMethodsOptionsarray [object]Returns an object of selected http methods in behavior configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected http method
cachedHttpMethodsinteger($int32)0Returns the http methods the user wants to cache for the cache behavior
cachedHttpMethodsOptionsarray [object]Returns an object of selected http method options the user wants to cache for the cache behavior
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cached http method
useCacheAndOriginRequestPolicybooltrueReturns the selected use a cache policy and origin request policy
cachePolicyIdinteger($int32)0Returns the user input of the cache policy identifier
cachePolicyOptionsarray [object]Returns an object of cache policy options which is "Disabled", "Optimized" or "Custom"
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cache policy
originRequestPolicyIdinteger($int32)0
originRequestPolicyOptionsarray [object]
idinteger($int32)0The identifier for the behavior
valuestring"string"
compressObjectsAutomaticallybooltrueReturns true if object is compressed automatically otherwise it returns false
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns the previous page of paganed data

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code: 401 Unauthorized
  • HTTP Status Code: 403 Forbidden
  • HTTP Status Code: 404 Not found

DELETE Behaviors#

Deletes the behavior associated with this id.

DELETE
MethodDELETE
URL or EndPoint/api/v{version}/projects/{projectId}/distributions/{distributionId}/behaviors/{id}
HeadersAuthorization
ParametersdistributionId, id, version, projectId
BodyNot Applicable

The description of the URL parameters is as follows:

URL Parameter NameMandatoryTypeExampleDescription
v{version}Yesstringv1Shows the version of API
{projectId}Yesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
{distributionId}Yesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
{id}Yesinteger($int32)0Shows the version of API

The description of the parameters is as follows:

Parameter NameMandatoryTypeExampleDescription
projectIdYesstring3fa85f64-5717-4562-b3fc-2c963f66afa6The project's ID. If the ID is empty, an empty distribution configuration is returned
versionYesstringv1Shows the version of API
distributionIdYesstring"string"The distribution's ID. If the ID is empty, an empty distribution configuration is returned
idYesinteger($int32)0The behavior's ID.
Responses#

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in json format by the service.

{  "success": true,  "errors": [    "string"  ],  "messages": [    "string"  ],  "result": {    "id": 0,    "distributionId": "string",    "pathPattern": "string",    "isOriginGroup": true,    "originId": 0,    "originOptions": [      {        "id": 0,        "value": "string"      }    ],    "originGroupOptions": [      {        "id": 0,        "value": "string"      }    ],    "viewerProtocolPolicy": 0,    "viewerProtocolPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "allowedHttpMethods": 0,    "allowedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "cachedHttpMethods": 0,    "cachedHttpMethodsOptions": [      {        "id": 0,        "value": "string"      }    ],    "useCacheAndOriginRequestPolicy": true,    "cachePolicyId": 0,    "cachePolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "originRequestPolicyId": 0,    "originRequestPolicyOptions": [      {        "id": 0,        "value": "string"      }    ],    "objectCaching": true,    "minimumTtl": 0,    "maximumTtl": 0,    "defaultTtl": 0,    "forwardCookies": 0,    "forwardCookiesOptions": [      {        "id": 0,        "value": "string"      }    ],    "queryStringForwardingAndCaching": 0,    "queryStringForwardingAndCachingOptions": [      {        "id": 0,        "value": "string"      }    ],    "compressObjectsAutomatically": true  },  "resultInfo": {    "totalCount": 0,    "pageIndex": 0,    "pageSize": 0,    "totalPages": 0,    "hasNextPage": true,    "hasPreviousPage": true  }}
Field NameTypeExampleDescription
successbooltrueIf response is success will return true otherwise will return false
errorsstring"string"Indicate if there was an error
messagesstring"string"Returns the response message from back-end
resultarray [object]Returns a behavior object
idinteger($int32)0The identifier for the behavior
distributionIdstring"string"Returns the identifier of distribution in behaviors
pathPatternstring"string"Returns pathPattern that you've specified in the configuration
isOriginGroupbooltrueReturns true if it is a origin group otherwise for the origin it returns false
originIdinteger($int32)0Returns the identifier of the origin
originOptionsarray [object]Returns all origin options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin options in behaviors configuration
originGroupOptionsarray [object]0Returns all origin group options in behaviors configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected origin group
viewerProtocolPolicystring"string"Returns viewer protocol policy selection in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
viewerProtocolPolicyOptionsarray [object]Returns viewer protocol policy all options in behavior configuration, e.g returns HTTP and HTTPS, redirect HTTP to HTTPS or HTTPS only
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected viewer protocol policy
allowedHttpMethodsinteger($int32)0Returns selected http methods in behavior configuration
allowedHttpMethodsOptionsarray [object]Returns an object of all http methods in behavior configuration
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected http method
cachedHttpMethodsinteger($int32)0Returns the http methods the user wants to cache for the cache behavior
cachedHttpMethodsOptionsarray [object]Returns an object of all http method options the user wants to cache for the cache behavior
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cached http method
useCacheAndOriginRequestPolicybooltrueReturns the selected use a cache policy and origin request policy
cachePolicyIdinteger($int32)0Returns the user input of the cache policy identifier
cachePolicyOptionsarray [object]Returns an object of cache policy options which is "Disabled", "Optimized" or "Custom"
idinteger($int32)0The identifier for the behavior
valuestring"string"Returns the selected cache policy
originRequestPolicyIdinteger($int32)0
originRequestPolicyOptionsarray [object]
idinteger($int32)0The identifier for the behavior
valuestring"string"
compressObjectsAutomaticallybooltrueReturns true if object is compressed automatically otherwise it returns false
resultInfoarray [object]Returns an object of behavior
totalCountinteger($int32)0How many records of behavior entity are in database
pageIndexinteger($int32)0Returns how many pages of paganed data are
pageSizeinteger($int32)0Returns paganed data
totalPagesinteger($int32)0How many pages
hasNextPagebooltrueReturns the next page of paganed data
hasPreviousPagebooltrueReturns the previous page of paganed data

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code: 401 Unauthorized
  • HTTP Status Code: 403 Forbidden
  • HTTP Status Code: 404 Not found