{"info":{"_postman_id":"d816408f-5f5f-48b5-8b0b-54acda78dadc","name":"CustomTypes API","description":"<html><head></head><body><h1 id=\"customtypes-api\">CustomTypes API</h1>\n<h2 id=\"how-to-setup-your-environment\">How to setup your environment</h2>\n<ul>\n<li>In your personal postman environment, create the following properties:<ul>\n<li><p><code>repository</code>: Domain of the repository you want to make operation on.</p>\n</li>\n<li><p><code>email</code>: Your email for authenticated operations</p>\n</li>\n<li><p><code>password</code>: Your password for authenticated operations</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>eg. If I want to make a custom type update for the repository <code>my-repository.prismic.io</code> then I'll need to fill these properties this way:<br><code>repository</code>: my-repository<br><code>email</code>: <a href=\"mailto:my@email.com\">my@email.com</a><br><code>password</code>: MyPassword</p>\n<p>You can now execute any request that is related to the environment you set up.</p>\n<h2 id=\"how-to-deal-with-errors\">How to deal with errors</h2>\n<ul>\n<li><p>Check that your environment is properly setup</p>\n</li>\n<li><p>Make sure that the repository you're trying to query has access to the custom types API, meaning that it must be on a slicemachine cluster.</p>\n</li>\n<li><p>Make sure that the <code>env</code> property and your crendentials match the environment of the repository meaning prod|stage|dev.</p>\n</li>\n<li><p>In any other case, please contact your fellow developers for help.</p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"CustomTypes API","slug":"customtypes-api"}],"owner":"5743666","collectionId":"d816408f-5f5f-48b5-8b0b-54acda78dadc","publishedId":"TzCHBqbH","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2024-07-25T16:54:37.000Z"},"item":[{"name":"Slices","item":[{"name":"Create slice","event":[{"listen":"prerequest","script":{"id":"7b2e7115-7f02-483c-98a8-ad93a80ca2a0","exec":["const deleteSlice = eval(pm.globals.get('deleteSlice'));","","const sliceId = pm.environment.get('sliceId')","","deleteSlice(sliceId)"],"type":"text/javascript"}},{"listen":"test","script":{"id":"649022bd-e262-4e9e-99b1-2b4a9b3dc59c","exec":["const repository = pm.environment.get('repository');","const token = pm.environment.get('token');","","pm.test(\"Create a slice\", () => {","    pm.expect(pm.response).to.have.property('code', 201)","})","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error)","","    pm.test(\"Should not create a slice if it does already exist\", () => {","        pm.expect(error).to.be.equal(null)","        pm.expect(response).to.have.property('code', 409)","        const sliceId = pm.environment.get('sliceId')","        pm.expect(response.text()).to.equal(`CONFLICT: ${sliceId} already exists.`)","    })","})"],"type":"text/javascript"}}],"id":"80861ab1-02af-49d3-8a0a-1945a5da7f9b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"{{sliceId}}\",\r\n  \"type\": \"SharedSlice\",\r\n  \"name\": \"CallToAction\",\r\n  \"description\": \"MySlice Template\",\r\n  \"variations\": [\r\n    {\r\n      \"id\": \"default-slice\",\r\n      \"name\": \"Default slice\",\r\n      \"docURL\": \"...\",\r\n      \"version\": \"sktwi83ykfdt588n\",\r\n      \"description\": \"MySlice Template\",\r\n      \"primary\": {\r\n        \"title\": {\r\n          \"type\": \"StructuredText\",\r\n          \"config\": {\r\n            \"single\": \"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"\r\n          }\r\n        }\r\n      },\r\n      \"items\": {\r\n        \"productTitle\": {\r\n          \"type\": \"StructuredText\",\r\n          \"config\": {\r\n            \"single\": \"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"\r\n          }\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://customtypes.{{env}}/slices/insert","urlObject":{"protocol":"https","path":["slices","insert"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"80861ab1-02af-49d3-8a0a-1945a5da7f9b"},{"name":"Update slice","event":[{"listen":"test","script":{"id":"76e369a0-673d-40cc-ad35-5ce31ce197f8","exec":["const repository = pm.environment.get('repository');","const token = pm.environment.get('token');","const raw = JSON.parse(pm.request.body.raw);","","pm.test(\"Update a slice\", () => {","    pm.expect(pm.response).to.have.property('code', 204);","})","","const updatedRaw = { ...raw, id: \"unknown\"};","const updatedBody = { ...pm.request.body, raw: JSON.stringify(updatedRaw) }","pm.request.body = updatedBody","","const headers = pm.request.getHeaders()","pm.request.header = {","    repository: headers.repository,","    Authorization: headers.Authorization","}","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Should not update a slice if it does already exist\", () => {","        pm.expect(error).to.be.equal(null);","        pm.expect(response).to.have.property('code', 422);","    })","});","",""],"type":"text/javascript"}}],"id":"7c634073-0a34-4d24-bb64-0af4e2f3b135","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"{{sliceId}}\",\r\n  \"type\": \"SharedSlice\",\r\n  \"name\": \"CallToActionV2\",\r\n  \"description\": \"MySlice Template\",\r\n  \"variations\": [\r\n    {\r\n      \"id\": \"default-slice\",\r\n      \"name\": \"Default slice\",\r\n      \"docURL\": \"...\",\r\n      \"version\": \"sktwi83ykfdt588n\",\r\n      \"description\": \"MySlice Template\",\r\n      \"primary\": {\r\n        \"title\": {\r\n          \"type\": \"StructuredText\",\r\n          \"config\": {\r\n            \"single\": \"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"\r\n          }\r\n        }\r\n      },\r\n      \"items\": {\r\n        \"productTitle\": {\r\n          \"type\": \"StructuredText\",\r\n          \"config\": {\r\n            \"single\": \"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"\r\n          }\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://customtypes.{{env}}/slices/update","urlObject":{"protocol":"https","path":["slices","update"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7c634073-0a34-4d24-bb64-0af4e2f3b135"},{"name":"Get slice","event":[{"listen":"prerequest","script":{"id":"619d1ff6-7d7a-4baa-a129-b1dda31e2a5b","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"8bd5f4cf-621d-40d5-8834-6eefa6bce512","exec":["const sliceId = pm.environment.get('sliceId')","","pm.test(\"Get a slice\", () => {","    pm.response.to.be.ok","    pm.response.to.be.withBody","    pm.response.to.be.json","","    const body = pm.response.json()","    pm.expect(body).to.have.property('id', sliceId)","","    pm.expect(body).to.deep.equal({\"id\":sliceId,\"type\":\"SharedSlice\",\"name\":\"CallToActionV2\",\"description\":\"MySlice Template\",\"variations\":[{\"id\":\"default-slice\",\"name\":\"Default slice\",\"docURL\":\"...\",\"version\":\"sktwi83ykfdt588n\",\"description\":\"MySlice Template\",\"primary\":{\"title\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"}}},\"items\":{\"productTitle\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"}}},\"imageUrl\":\"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format\"}]})","})","","const url = pm.request.url.toString()","pm.request.url.update(url.replace(sliceId, '404'));","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"404 if slice doesn't exist\", () => {","        pm.expect(error).to.be.equal(null);","        pm.expect(response).to.have.property('code', 404);","    })","});"],"type":"text/javascript"}}],"id":"e3510894-f887-42e6-ae59-3453605cba6e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/slices/{{sliceId}}","urlObject":{"protocol":"https","path":["slices","{{sliceId}}"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e3510894-f887-42e6-ae59-3453605cba6e"},{"name":"Get all slices","event":[{"listen":"prerequest","script":{"id":"c788f942-9bcb-4091-b814-c9f8cb93d322","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"026a4c60-f7eb-47ca-bd15-05aca44555a7","exec":["const sliceId = pm.environment.get('sliceId')","","pm.test(\"Get all slices\", () => {","    pm.response.to.be.ok","    pm.response.to.be.withBody","    pm.response.to.be.json","","    const body = pm.response.json()","","    const slice = body.find(({id}) => id === sliceId);","    pm.expect(slice).to.deep.equal({\"id\":sliceId,\"type\":\"SharedSlice\",\"name\":\"CallToActionV2\",\"description\":\"MySlice Template\",\"variations\":[{\"id\":\"default-slice\",\"name\":\"Default slice\",\"docURL\":\"...\",\"version\":\"sktwi83ykfdt588n\",\"description\":\"MySlice Template\",\"primary\":{\"title\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"}}},\"items\":{\"productTitle\":{\"type\":\"StructuredText\",\"config\":{\"single\":\"paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl\"}}},\"imageUrl\":\"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format\"}]})","","})","","","pm.test(\"Response schema is correct\", function () {","    const schema = {","        \"type\": \"array\",","        \"items\": {","            \"type\": \"object\",","            \"properties\": {","                \"id\": { \"type\": \"string\" },","                \"type\": { \"type\": \"string\" },","                \"name\": { \"type\": \"string\" },","                \"description\": { \"type\": \"string\" },","                \"variations\": {","                    \"type\": \"array\",","                    \"items\": {","                        \"type\": \"object\"","                    }","                }","            }","        }","    };","","    pm.expect(pm.response.json()).to.be.jsonSchema(schema);","});"],"type":"text/javascript"}}],"id":"6614ab29-1fb5-4144-80ff-1cea8d1f095c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/slices","urlObject":{"protocol":"https","path":["slices"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6614ab29-1fb5-4144-80ff-1cea8d1f095c"},{"name":"Delete slice","event":[{"listen":"prerequest","script":{"id":"619d1ff6-7d7a-4baa-a129-b1dda31e2a5b","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"acdcadc4-abc3-4e68-9310-dd6b3d63111a","exec":["pm.test(\"Should delete a slice\", () => {","    pm.expect(pm.response).to.have.property('code', 204)","})","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error)","","    pm.test(\"Should not throw any errors if the slice does not exist\", () => {","        pm.expect(error).to.be.equal(null)","        pm.expect(response).to.have.property('code', 204)","    })","})"],"type":"text/javascript"}}],"id":"e2f8290e-a78d-484c-b51e-f0dd6931b157","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"DELETE","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/slices/{{sliceId}}","urlObject":{"protocol":"https","path":["slices","{{sliceId}}"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e2f8290e-a78d-484c-b51e-f0dd6931b157"}],"id":"cf39354e-9af4-4d1c-a20d-29f533584c4a","_postman_id":"cf39354e-9af4-4d1c-a20d-29f533584c4a","description":""},{"name":"Custom types","item":[{"name":"Create custom type","event":[{"listen":"test","script":{"id":"367cd605-3f46-4693-b370-af7ae9f4f0b4","exec":["const repository = pm.environment.get('repository');","const token = pm.environment.get('token');","","pm.test(\"Create a custom type\", () => {","    pm.expect(pm.response).to.have.property('code', 201)","})","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error)","","    pm.test(\"Should not create a custom type if it does already exist\", () => {","        pm.expect(error).to.be.equal(null)","        pm.expect(response).to.have.property('code', 409)","        pm.expect(response.text()).to.equal('Custom type already exists')","        ","    })","})","",""],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"54b4aab2-b986-4caf-9bd5-ff278374d97c","exec":["const deleteCustomType = eval(pm.globals.get('deleteCustomType'));","","const ctId = pm.environment.get('customTypeId')","","deleteCustomType(ctId)"],"type":"text/javascript"}}],"id":"b685ce87-3cb4-4520-9929-5bd0fbe1ad51","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"{{customTypeId}}\",\r\n    \"label\": \"Home page\",\r\n    \"repeatable\": true,\r\n    \"status\": true,\r\n    \"json\": {\r\n        \"Main\": {\r\n            \"uid\": {\r\n                \"config\": {\r\n                    \"label\": \"UID\"\r\n                },\r\n                \"type\": \"UID\"\r\n            }\r\n        }\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://customtypes.{{env}}/customtypes/insert","urlObject":{"protocol":"https","path":["customtypes","insert"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b685ce87-3cb4-4520-9929-5bd0fbe1ad51"},{"name":"Update custom type","event":[{"listen":"test","script":{"id":"5bd74fa0-a9f1-40f5-83f7-7c6a0f5e101d","exec":["const repository = pm.environment.get('repository');","const token = pm.environment.get('token');","const ctId = pm.environment.get('customTypeId');","const raw = JSON.parse(pm.request.body.raw);","","pm.test(\"Update a custom type\", () => {","    pm.expect(pm.response).to.have.property('code', 204);","})","","const updatedRaw = { ...raw, id: \"unknown\"};","const updatedBody = { ...pm.request.body, raw: JSON.stringify(updatedRaw) }","pm.request.body = updatedBody","","const headers = pm.request.getHeaders()","pm.request.header = {","    repository: headers.repository,","    Authorization: headers.Authorization","}","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Should not update a custom type if it does already exist\", () => {","        pm.expect(error).to.be.equal(null);","        pm.expect(response).to.have.property('code', 422);","    })","});","",""],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"268e7e35-6908-4e62-99d0-fa6f17cba9d1","exec":[""],"type":"text/javascript"}}],"id":"40c6eeb6-fd44-4e31-98c7-bdf6a031e68b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"{{customTypeId}}\",\r\n    \"label\": \"Home page v2\",\r\n    \"repeatable\": false,\r\n    \"status\": true,\r\n    \"json\": {\r\n        \"Main\": {}\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://customtypes.{{env}}/customtypes/update","urlObject":{"protocol":"https","path":["customtypes","update"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"40c6eeb6-fd44-4e31-98c7-bdf6a031e68b"},{"name":"Get custom type","event":[{"listen":"prerequest","script":{"id":"96d04bcd-45e4-4882-ac11-06a1a626c88d","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"6d7ce5cd-cceb-4feb-974e-ab92934e8c92","exec":["const ctId = pm.environment.get('customTypeId')","","pm.test(\"Get a custom type\", () => {","    pm.response.to.be.ok","    pm.response.to.be.withBody","    pm.response.to.be.json","","    const body = pm.response.json()","    pm.expect(body).to.have.property('id', ctId)","","    pm.expect(body).to.deep.equal({","        \"id\": ctId,","        \"label\": \"Home page v2\",","        \"repeatable\": true,","        \"status\": true,","        \"json\": {","            \"Main\": {}","        },","        \"format\": \"custom\"","    })","})","","const url = pm.request.url.toString()","pm.request.url.update(url.replace(ctId, '404'));","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"404 if custom type doesn't exist\", () => {","        pm.expect(error).to.be.equal(null);","        pm.expect(response).to.have.property('code', 404);","    })","});",""],"type":"text/javascript"}}],"id":"8b9ae0e0-d7de-48dd-9e82-5043e13fdcf3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/customtypes/{{customTypeId}}","urlObject":{"protocol":"https","path":["customtypes","{{customTypeId}}"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8b9ae0e0-d7de-48dd-9e82-5043e13fdcf3"},{"name":"Get all custom types","event":[{"listen":"prerequest","script":{"id":"5e8563bb-7ccd-48e2-ad1d-6f080c5736c5","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"9f674902-424d-4cb8-b70d-9396d8f30469","exec":["const ctId = pm.environment.get('customTypeId')","","pm.test(\"Get all custom types\", () => {","    pm.response.to.be.ok","    pm.response.to.be.withBody","    pm.response.to.be.json","","    const body = pm.response.json()","    const customType = body.find(({id}) => id === ctId);","    pm.expect(customType).to.deep.equal({","        \"id\": ctId,","        \"label\": \"Home page v2\",","        \"repeatable\": true,","        \"status\": true,","        \"json\": {","            \"Main\": {}","        },","        \"format\": \"custom\"","    })","})","","pm.request.addQueryParams('id='+ctId)","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Get all custom types - filter by ids\", () => {","        pm.expect(response).to.be.ok","        pm.expect(response).to.be.withBody","        pm.expect(response).to.be.json","","        const body = response.json()","        pm.expect(body).is.not.null","        pm.expect(body).to.have.lengthOf(1)","        pm.expect(body).to.deep.equal([{","            \"id\": ctId,","            \"label\": \"Home page v2\",","            \"repeatable\": true,","            \"status\": true,","            \"json\": {","                \"Main\": {}","            },","            \"format\": \"custom\"","        }])","    })","})","","pm.request.removeQueryParams('id')","pm.request.addQueryParams('id=404')","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Get all custom types - filter by ids 404\", () => {","        pm.expect(response).to.be.ok","        pm.expect(response).to.be.withBody","        pm.expect(response).to.be.json","","        const body = response.json()","        pm.expect(body).is.not.null","        pm.expect(body).to.have.lengthOf(0)","    })","})"],"type":"text/javascript"}}],"id":"69c32114-0b7d-47ad-b817-fa534f1114a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/customtypes?id={{customTypeId}}","urlObject":{"protocol":"https","path":["customtypes"],"host":["customtypes","{{env}}"],"query":[{"key":"id","value":"{{customTypeId}}"}],"variable":[]}},"response":[],"_postman_id":"69c32114-0b7d-47ad-b817-fa534f1114a1"},{"name":"Get all custom types static","event":[{"listen":"prerequest","script":{"id":"5e8563bb-7ccd-48e2-ad1d-6f080c5736c5","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"9f674902-424d-4cb8-b70d-9396d8f30469","exec":["const ctId = pm.environment.get('customTypeId')","","pm.test(\"Get all custom types\", () => {","    pm.response.to.be.ok","    pm.response.to.be.withBody","    pm.response.to.be.json","","    const body = pm.response.json()","    const customType = body.results.find(({id}) => id === ctId);","","    pm.expect(customType).to.deep.equal({","            \"id\": ctId,","            \"label\": \"Home page v2\",","            \"repeatable\": true,","            \"status\": true,","            \"json\": {","                \"Main\": {}","            },","            \"format\": \"custom\"","        }","    )","})","","pm.request.addQueryParams('id='+ctId)","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Get all custom types - filter by ids\", () => {","        pm.expect(response).to.be.ok","        pm.expect(response).to.be.withBody","        pm.expect(response).to.be.json","","        const body = response.json()","        pm.expect(body).is.not.null","        pm.expect(body).to.deep.equal({","            \"results\": [{","                \"id\": ctId,","                \"label\": \"Home page v2\",","                \"repeatable\": true,","                \"status\": true,","                \"json\": {","                    \"Main\": {}","                },","                \"format\": \"custom\"","            }],","            \"page\": 1,","            \"totalPages\": 1","        })","    })","})","","pm.request.removeQueryParams('id')","pm.request.addQueryParams('id=404')","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error);","    pm.test(\"Get all custom types - filter by ids 404\", () => {","        pm.expect(response).to.be.ok","        pm.expect(response).to.be.withBody","        pm.expect(response).to.be.json","","        const body = response.json()","        pm.expect(body).is.not.null","        pm.expect(body.results).to.have.lengthOf(0)","    })","})"],"type":"text/javascript"}}],"id":"7bb6915b-705e-4fe7-b24b-7d3fa43eb124","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"GET","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"url":"https://customtypes.{{env}}/customtypesstatic","urlObject":{"protocol":"https","path":["customtypesstatic"],"host":["customtypes","{{env}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7bb6915b-705e-4fe7-b24b-7d3fa43eb124"},{"name":"Delete custom type","event":[{"listen":"test","script":{"id":"692d7850-fecd-45af-acf2-ab1be5c028a7","exec":["pm.test(\"Should delete a custom type\", () => {","    pm.expect(pm.response).to.have.property('code', 204)","})","","pm.sendRequest(pm.request, (error, response) => {","    if (error) console.log(error)","","    pm.test(\"Should not throw any errors if the custom type does not exist\", () => {","        pm.expect(error).to.be.equal(null)","        pm.expect(response).to.have.property('code', 204)","    })","})"],"type":"text/javascript"}}],"id":"67a14d8b-0942-4cb7-9471-8028c9c29de1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":false},"method":"DELETE","header":[{"key":"repository","type":"text","value":"{{repository}}"}],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"home\",\r\n    \"label\": \"Home page\",\r\n    \"repeatable\": false,\r\n    \"status\": true,\r\n    \"json\": {\r\n        \"Main\": {}\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://customtypes.{{env}}/customtypes/{{customTypeId}}","urlObject":{"protocol":"https","path":["customtypes","{{customTypeId}}"],"host":["customtypes","{{env}}"],"query":[{"disabled":true,"key":"ctid","value":"home"}],"variable":[]}},"response":[],"_postman_id":"67a14d8b-0942-4cb7-9471-8028c9c29de1"}],"id":"9d1e3269-ee00-4b7e-94df-a8c092b88f99","_postman_id":"9d1e3269-ee00-4b7e-94df-a8c092b88f99","description":""}],"event":[{"listen":"prerequest","script":{"id":"1ca240d5-94e1-4532-a797-0b2c423e89c4","type":"text/javascript","exec":["deleteCustomType = (ctId, callback) => {","    const repository = pm.environment.get('repository');","    const token = pm.environment.get('token');","","    pm.sendRequest({","        url: `https://customtypes.wroom.io/customtypes/${ctId}`,","        method: \"DELETE\",","        header: {","            repository,","            Authorization: `Bearer ${token}`,","        }","    }, callback);","}","","deleteSlice = (sliceId, callback) => {","    const repository = pm.environment.get('repository');","    const token = pm.environment.get('token');","","    pm.sendRequest({","        url: `https://customtypes.wroom.io/slices/${sliceId}`,","        method: \"DELETE\",","        header: {","            repository,","            Authorization: `Bearer ${token}`,","        }","    }, callback);","}","","getCustomType = (ctId, callback) => {","    const repository = pm.environment.get('repository');","    const token = pm.environment.get('token');","","    pm.sendRequest({","        url: `https://customtypes.wroom.io/customtypes/${ctId}`,","        method: \"GET\",","        header: {","            repository,","            Authorization: `Bearer ${token}`,","        }","    }, callback);","}","","pm.globals.set('deleteSlice', new String(deleteSlice))","pm.globals.set('deleteCustomType', new String(deleteCustomType))","pm.globals.set('getCustomType', new String(getCustomType))"]}},{"listen":"test","script":{"id":"855e76c8-2a54-4ea2-91ba-f01ff743c43a","type":"text/javascript","exec":["//pm.environment.unset('token')"]}}]}