This section describes how you can perform operations on the /gsadmin/v1/cloud/redirects endpoint to get, create, modify, and replace the configuration of a redirects object. It contains the following sections:
Redirect-group object attributes
The following table lists the attributes of redirect-group objects:
Attribute | Required? | Type | Values |
|---|---|---|---|
| yes | String |
Note: One or more |
Export redirect-group object in ZIP format
Use an endpoint of the following form to export configuration of a redirect-group object in ZIP format:
GET /gsadmin/v1/cloud/redirects/redirect-group-name.ZIPThe ZIP file in which the configuration is downloaded contains the following _.JSON files:
A file containing the configuration of the
redirectsobject; for example:
{
"ecr:lastModifiedBy": "occ_admin",
"ecr:lastModified": "2016-10-26T17:11:47.308Z",
"ecr:createDate": "2016-10-26T09:32:32.602-07:00",
"ecr:type": "redirects"
}An individual
_.JSONfile for eachredirect-groupobject inredirects; for example, the configuration of the Defaultredirect-groupobject can be as follows:
{
"ecr:lastModifiedBy": "occ_admin",
"ecr:lastModified": "2016-10-26T10:11:47.369-07:00",
"ecr:createDate": "2016-10-26T10:11:47.369-07:00",
"ecr:type": "redirect-group",
"id1": {
"ecr:type": "redirect-entry",
"searchTerms": "canon",
"matchmode": "MATCHEXACT",
"url": "/browse/Canon/_/N-1z141ya",
"searchTermExpansions": {
"0":{"canon": ["canon"]}
}
},
"id2": {
"ecr:type": "redirect-entry",
"searchTerms": "contacts",
"matchmode": "MATCHEXACT",
"url": "/contact-us",
"searchTermExpansions": {
"0": {"contacts": ["contact"]}
}
}
}Note: searchTermExpansions is a system-generated attribute. Do not delete or modify it.
Export redirect-group object in JSON format
Use an endpoint of the following form to export configuration of a redirect-group object in JSON format:
GET /gsadmin/v1/cloud/redirects/redirect-group-name.json, orGET /gsadmin/v1/cloud/redirects/redirect-group-nameFor example, the following endpoint exports configuration of a redirect-group named Default:
GET /gsadmin/v1/cloud/redirects/Default
The following JSON illustrates content of the file to which the configuration of the Default redirect-group object is exported; note that the configuration of the two redirect-entry child objects under Default is contained in this same file:
{
"ecr:type": "redirect-group",
"id1": {
"ecr:type": "redirect-entry",
"searchTerms": "canon",
"matchmode": "MATCHEXACT",
"url": "/browse/Canon/_/N-1z141ya",
"searchTermExpansions": {
"0": {"canon": ["canon"]}
}
},
"id2": {
"ecr:type": "redirect-entry",
"searchTerms": "contacts",
"matchmode": "MATCHEXACT",
"url": "/contact-us",
"searchTermExpansions": {
"0": {"contacts": ["contact"]}
}
}
}Note: searchTermExpansions is a system-generated attribute. Do not delete or modify it.
Create a redirect-group object
If no redirect-group object currently exists, you can create one using the POST method. If a redirect-group object currently exists, however, you do not need to create another. One redirect-group object is sufficient for all ordinary purposes.
Use a POST endpoint of the following form to create a redirect-group object, in JSON format or ZIP format:
POST /gsadmin/v1/cloud/redirects/redirect-group-nameThe JSON content that configures the redirect-group object can include the configuration of the redirect-entry objects that the redirect-group is to contain; for example, the following content supplied to the POST endpoint above creates a redirect-group object containing two redirect-entry objects, id1 and id2:
{
"ecr:type": "redirect-group",
"id1": {
"ecr:type": "redirect-entry",
"searchTerms": "canon",
"matchmode": "MATCHEXACT",
"url": "/browse/Canon/_/N-1z141ya",
"searchTermExpansions": {
"0": {"canon": ["canon"]}
}
},
"id2": {
"ecr:type": "redirect-entry",
"searchTerms": "contacts",
"matchmode": "MATCHEXACT",
"url": "/contact-us",
"searchTermExpansions": {
"0": {"contacts": ["contact"]}
}
}
}Modify a redirect-group object
You can modify a redirect-group object using the PATCH method.
In JSON format, use the following endpoint to replace the entire configuration of a specified redirect-group:
PATCH /gsadmin/v1/cloud/redirects/redirect-group-nameNote: The PATCH method cannot be used with ZIP format.
The endpoint above can be executed with the following JSON content to replace the current configuration of the redirect-group named Default:
{
"ecr:type": "redirect-group",
"id1": {
"ecr:type": "redirect-entry",
"searchTerms": "canon",
"matchmode": "MATCHEXACT",
"url": "/browse/Canon/_/N-1z141ya"
},
"id2": {
"ecr:type": "redirect-entry",
"searchTerms": "contacts",
"matchmode": "MATCHEXACT",
"url": "/contact-us"
}
}
