TS Commerce Developers

Rewrites API

Current version: v1.1

List rewrites

GET
/rewrites/list.json
						
[
    {
        "id": "5b11651ebc3921dbe8bfc328",
        "from": "/old-page",
        "to": "/new-page",
        "http_code": "301",
        "add_date": "2018-06-01T17:24:14+0200"
    },
	...
]
						
					

Create new rewrite

POST
/rewrites/rewrite.json
PARAMETERS LIST
from required (string) Old rewrite you want to redirect to new url
to required (string) Routing destination url
http_code (string) Values:
301 => Permanent
302 => Temporarily Moved
200 => 200 Ok Create an empty blank page that produce an http/1.1 200 ok
						
{
    "ok": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": false
}
						
					

Remove rewrite

DELETE
/rewrites/rewrite.json
PARAMETERS LIST
id required (StoredenID) Unique id of rewrite url
After removal, data propagation can take a few minutes
						
{
    "ok": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": false
}