{"_id":"58112e72ded0340f0085d041","project":"551e85be610f400d00837db7","__v":0,"category":{"_id":"58112e72ded0340f0085d032","project":"551e85be610f400d00837db7","__v":0,"version":"58112e71ded0340f0085d02a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-17T19:28:09.961Z","from_sync":false,"order":7,"slug":"merchant-api-methods","title":"Merchant API Methods"},"user":"55253acaf0f4610d00f7193f","version":{"_id":"58112e71ded0340f0085d02a","project":"551e85be610f400d00837db7","__v":4,"createdAt":"2016-10-26T22:30:09.862Z","releaseDate":"2016-10-26T22:30:09.862Z","categories":["58112e72ded0340f0085d02b","58112e72ded0340f0085d02c","58112e72ded0340f0085d02d","58112e72ded0340f0085d02e","58112e72ded0340f0085d02f","58112e72ded0340f0085d030","58112e72ded0340f0085d031","58112e72ded0340f0085d032","58112e72ded0340f0085d033","58112e72ded0340f0085d034","581137cc604d3c230048b7e4","58dc367221742d0f00a73f98","590768e54669da0f00db5c0b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"new designer","version_clean":"2.0.0","version":"2.0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-21T04:26:13.477Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"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._","excerpt":"","slug":"page-redirect-methods","type":"basic","title":"Page Redirect Methods"}

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._