QueryOriginUriAndHost

Update time: 2026-08-14 11:22:34

Applicable Products

Content Acceleration,Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast

API Description

Query back source URI and host rewrite

Call frequency

Single user trigger frequency: 300/5min

Request parameter(s)

Path Params

NameDescription
*domainNameString
domainName or domainId.

Response parameter(s)

Body Params

NameDescription
domain-nameString
domainName.
domain-idString
domainId.
originRulesRewritesList
Return path rewrite configuration 1. When you need to set the rewrite configuration of the backsource path, this must be filled in 2. Rewrite configuration for clearing the return path for .
dataIdLong
Add a grid type identifier to represent a specific group of configurations when a customer has multiple groups of configurations Note: Add grid type identifier: data-id, each group configuration corresponds to a data-id: a. If the customer has passed data-id, specify that modifying one group of configuration items content does not require modifying other group configuration content does not need to be included; B. If the customer enters multiple groups of configuration, some of them have data-id, some have not. If there is transmission, the expression of data-id is used to modify a specific group of configurations, but no expression of data-id is used to add a new group of configurations on the original basis; C. If no data-id is transmitted to the customer, it means that the original configuration is completely covered by this configuration; D. If no configuration parameters are transmitted to the customer, only the domain name and the second level are transmitted. Label, which indicates that clearing this interface corresponds to all configuration of domain name secondary service. (c, D content is consistent with the current solution); e, a gird tag can not be empty, if there is no specific configuration item, then data-id must be filled in, and the value is the actual data-id, indicating the value of clearing this data-id corresponding configuration item;
pathPatternString
The URL matching mode supports regularization. If all matches are made, the input can be configured as:.*
pathPatternHttpString
The protocol of URL matching mode, which is used with path-pattern, is supported by adding parameters: default is empty, blank is default is to support HTTP and HTTPS protocol before URL matching mode path is needed at the same time; Http: URL matches pattern path with HTTP protocol Https: URL matches pattern path with HTTPS protocol Ignore: URL matching mode path without protocol
exceptPathPatternString
Exceptional URL matching pattern in the same format as path pattern
exceptPathPatternHttpString
Exceptional URL matching mode protocol, which is used in conjunction with except-path-pattern; participation support: default is empty, blank is default is required to support both HTTP and HTTPS protocol before URL matching mode path; Http: URL matches pattern path with HTTP protocol. Https: URL matches pattern path with HTTPS protocol. Ignore: URL matching mode path without protocol.
ignoreLetterCaseBoolean
Ignore case: Allowed values are true and false, the default is ignored.
originInfoString
Back-source information, you can enter IP or domain name. That is, customer source IP or domain name
priorityInteger
Represents the priority execution order of the customer's multi-group redirected content. The bigger the number, the higher the priority.
originHostString
Back source host,that support to enter domain names; Example: The backsource host of domain name A configures domain name B. When the A domain name requests the source, the requested URL uses the B domain name instead of the A domain name.
beforeRewritedUriString
Pre-rewrite uri. That is, the original request URI for user access. Support regular configuration
afterRewritedUriString
The rewritten uri, that is, the request uri configured in before-rewritten-uri, uses the rewritten uri to return to the source. Realize the rewriting of the back-to-source path. Support regular configuration.

Error code

Error code(code)Description(message)HTTP statusSemantic
26938005Request parameter format specification error, domain not passed in or empty404Request parameter format specification error, domain not passed in or empty
26932001Request account cannot operate the requested domain name404Request account cannot operate the requested domain name
26932002Domain name does not belong to the customer400Domain name does not belong to the customer
26939999System internal exception, please try again later500System internal exception, please try again later
0query was successful200query was successful

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/api/config/originrulesrewrites/123344"  \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json"
Response example
Copy Copy success
HTTP/1.1 200 OK
Date: Sun, 05 May 2019 09:08:53 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id: 83bbebc7-2c95-47d7
{
    "code":"0",
    "message":"success",
    "data":{
        "domain-id":"3868071",
        "domain-name":"www.livestream.1563907889301572.com",
        "originRulesRewrites":[
            {
                "afterRewritedUri":"index.jsp",
                "beforeRewritedUri":"home.jsp",
                "dataId":32534969,
                "exceptPathPattern":"*.jsp",
                "exceptPathPatternHttp":"https",
                "ignoreLetterCase":"true",
                "originHost":"b.com",
                "originInfo":"a.com",
                "pathPattern":".*",
                "pathPatternHttp":"http",
                "priority":"5"
            }
        ]
    }
}