{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Page Redirect Methods","type":"basic","slug":"page-redirect-methods","excerpt":"","body":"See the [Page Redirect](doc:page-redirect) documentation for information about page redirects.\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method put\\\">PUT</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/{page_redirect_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method post\\\">POST</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/\\n  </span>\\n</div>\"\n}\n[/block]\n# List page redirects\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.get(\\\"https://api.cratejoy.com/v1/page_redirects/\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"count\\\": 1,\\n  \\\"next\\\": \\\"?page=1\\\",\\n  \\\"prev\\\": null,\\n  \\\"results\\\": [\\n    {\\n      \\\"id\\\": 755285,\\n      \\\"enabled\\\": true,\\n      \\\"path\\\": \\\"/my_old_blog_post.html\\\",\\n      \\\"code\\\": 302, \\n      \\\"target\\\": \\\"https://oldsite.com/blog_post.html\\\", \\n      \\\"type\\\": \\\"page_redirect\\\", \\n      \\\"url\\\": \\\"/v1/page_redirects/755285/\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n# Update a page redirect\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method put\\\">PUT</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/{page_redirect_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n    url: 'https://api.cratejoy.com/v1/page_redirects/755285/',\\n    contentType: 'application/json',\\n    type: 'PUT',\\n    data: { 'target': 'http://my.newsite.com/new_page.html' }\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n_See the [Page Redirect](doc:page-redirect) documentation for a complete list of writeable properties._\n\n# Create a new redirect\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method post\\\">POST</span>\\n  <span class=\\\"uri\\\">\\n    https://api.cratejoy.com/v1/page_redirects/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.post(\\\"https://api.cratejoy.com/v1/page_redirects/\\\",{\\n  \\t\\\"path\\\": \\\"/my_old_blog_post.html\\\",\\n\\t\\t\\\"target\\\": \\\"https://oldsite.com/blog_post.html\\\",\\n\\t\\t\\\"code\\\": 302,\\n\\t\\t\\\"enabled\\\": true\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n_See the [Page Redirect](doc:page-redirect) documentation for a complete list of writeable properties._","updates":[],"order":5,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"58112e72ded0340f0085d041","project":"551e85be610f400d00837db7","__v":0,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Merchant API Methods","slug":"merchant-api-methods","order":7,"from_sync":false,"reference":false,"_id":"58112e72ded0340f0085d032","project":"551e85be610f400d00837db7","__v":0,"version":"58112e71ded0340f0085d02a","createdAt":"2015-08-17T19:28:09.961Z"},"createdAt":"2015-10-21T04:26:13.477Z","githubsync":"","user":"55253acaf0f4610d00f7193f","version":{"version":"2.0","version_clean":"2.0.0","codename":"new designer","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["58112e72ded0340f0085d02b","58112e72ded0340f0085d02c","58112e72ded0340f0085d02d","58112e72ded0340f0085d02e","58112e72ded0340f0085d02f","58112e72ded0340f0085d030","58112e72ded0340f0085d031","58112e72ded0340f0085d032","58112e72ded0340f0085d033","58112e72ded0340f0085d034","581137cc604d3c230048b7e4","58dc367221742d0f00a73f98","590768e54669da0f00db5c0b"],"_id":"58112e71ded0340f0085d02a","createdAt":"2016-10-26T22:30:09.862Z","project":"551e85be610f400d00837db7","releaseDate":"2016-10-26T22:30:09.862Z","__v":4},"parentDoc":null}

Page Redirect Methods


See the [Page Redirect](doc:page-redirect) documentation for information about page redirects. [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/\n </span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/{page_redirect_id}/\n </span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method post\">POST</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/\n </span>\n</div>" } [/block] # List page redirects [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.get(\"https://api.cratejoy.com/v1/page_redirects/\");", "language": "javascript" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 1,\n \"next\": \"?page=1\",\n \"prev\": null,\n \"results\": [\n {\n \"id\": 755285,\n \"enabled\": true,\n \"path\": \"/my_old_blog_post.html\",\n \"code\": 302, \n \"target\": \"https://oldsite.com/blog_post.html\", \n \"type\": \"page_redirect\", \n \"url\": \"/v1/page_redirects/755285/\"\n }\n ]\n}", "language": "json" } ] } [/block] # Update a page redirect [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method put\">PUT</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/{page_redirect_id}/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.ajax({\n url: 'https://api.cratejoy.com/v1/page_redirects/755285/',\n contentType: 'application/json',\n type: 'PUT',\n data: { 'target': 'http://my.newsite.com/new_page.html' }\n});", "language": "javascript" } ] } [/block] _See the [Page Redirect](doc:page-redirect) documentation for a complete list of writeable properties._ # Create a new redirect [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method post\">POST</span>\n <span class=\"uri\">\n https://api.cratejoy.com/v1/page_redirects/\n </span>\n</div>" } [/block] [block:code] { "codes": [ { "code": "$.post(\"https://api.cratejoy.com/v1/page_redirects/\",{\n \t\"path\": \"/my_old_blog_post.html\",\n\t\t\"target\": \"https://oldsite.com/blog_post.html\",\n\t\t\"code\": 302,\n\t\t\"enabled\": true\n});", "language": "javascript" } ] } [/block] _See the [Page Redirect](doc:page-redirect) documentation for a complete list of writeable properties._