{"info":{"_postman_id":"4dc81d0a-3474-4310-9b9b-0dfa11e687d8","name":"cosmedcloud Public GraphQL API","description":"<html><head></head><body><p>Available for cosmedcloud clients.</p>\n<h2 id=\"what-can-it-do\">What can it do?</h2>\n<p>Our GraphQL API currently supports the following object types:</p>\n<ul>\n<li>Clients (create, update, search and retrieve)</li>\n<li>Medical notes (create &amp; list)</li>\n</ul>\n<p>You can access data by issuing GraphQL queries to the endpoint or by subscribing to data types via webhooks.</p>\n<p>We are ever-expanding our API.</p>\n<h2 id=\"what-is-graphql\">What is GraphQL</h2>\n<p>cosmedcloud has chosen GraphQL as the new language to build our API on.</p>\n<p><em>GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.</em></p>\n<p>Learn at <a href=\"https://graphql.org/learn/\">https://graphql.org/learn/</a></p>\n<h2 id=\"how-do-i-access\">How do I access?</h2>\n<p>Request credentials via cosmedcloud support at <a href=\"mailto:help@cosmedcloud.com\">help@cosmedcloud.com</a></p>\n<h2 id=\"endpoints\">Endpoints</h2>\n<ul>\n<li>API hosted at <a href=\"https://graphql.cosmedcloud.com\">https://graphql.cosmedcloud.com</a></li>\n<li>GraphQL API hosted at <a href=\"https://graphql.cosmedcloud.com/graphql\">https://graphql.cosmedcloud.com/graphql</a></li>\n</ul>\n<h2 id=\"status-page\">Status Page</h2>\n<p>We recommend you subscribe to service status updates at <a href=\"https://status.cosmedcloud.com\">https://status.cosmedcloud.com</a></p>\n<h2 id=\"how-to-use-this-postman-collection\">How to use this Postman collection</h2>\n<p>We have setup this collection as a ready to roll client. Simply set your OAuth_ClientID and OAuth_ClientSecret variables then execute the \"Authorizatin - #1 Request Token\" request.</p>\n<p>This will request a access token using the supplied variables then save the token as OAuth_BearerToken which is used as a variable in all subsequent requests.</p>\n<p>Remember - access tokens are limited to 1 hour. You will need to request a new token. </p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"11029849","collectionId":"4dc81d0a-3474-4310-9b9b-0dfa11e687d8","publishedId":"TVCjx62p","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"447fc7"},"publishDate":"2021-09-30T06:17:30.000Z"},"item":[{"name":"Authorization","item":[{"name":"#1 Request token","event":[{"listen":"test","script":{"id":"4abd6e77-2e18-4710-8bbc-0951205f65e6","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains access token\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.access_token);","});","","pm.environment.set(\"OAuth_BearerToken\", jsonData.access_token);"],"type":"text/javascript"}}],"id":"fed6cd45-b7dd-440c-9a76-3211bdf69997","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"},{"key":"client_id","value":"{{OAuth_ClientID}}","description":"<p>Use your provided client ID from cosmedcloud. Keep this value secure</p>\n","type":"text"},{"key":"client_secret","value":"{{OAuth_ClientSecret}}","description":"<p>Use your provided client secret from cosmedcloud. Keep this value secure</p>\n","type":"text"},{"key":"scopes","value":"cosmedcloud_api,cosmedcloud_pii","description":"<p>Add cosmedcloud_pii to the scopes list if you requires access to PII data</p>\n","type":"text"}]},"url":"{{Host}}/connect/token","description":"<p>Make a request to the token endpoint to obtain your token</p>\n","urlObject":{"path":["connect","token"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"14638bb2-7134-4208-8ec8-66994b6a984f","name":"#1 Request a token","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"},{"key":"client_id","value":"{{ClientID}}","description":"Use your provided client ID from cosmedcloud. Keep this value secure","type":"text"},{"key":"client_secret","value":"{{ClientSecret}}","description":"Use your provided client secret from cosmedcloud. Keep this value secure","type":"text"},{"key":"scopes","value":"cosmedcloud_api,cosmedcloud_pii","description":"Add cosmedcloud_pii to the scopes list if you requires access to PII data","type":"text"}]},"url":"{{Host}}/connect/token"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 08 Sep 2020 23:22:51 GMT"},{"key":"Content-Type","value":"application/json; charset=UTF-8"},{"key":"Server","value":"Kestrel"},{"key":"Cache-Control","value":"no-store, no-cache, max-age=0"},{"key":"Pragma","value":"no-cache"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"access_token\": \"**MASKED**\",\n    \"expires_in\": 3600,\n    \"token_type\": \"Bearer\",\n    \"scope\": \"cosmedcloud_api cosmedcloud_pii\"\n}"}],"_postman_id":"fed6cd45-b7dd-440c-9a76-3211bdf69997"}],"id":"2c447c84-237f-4838-a11e-b302804725b2","description":"<p>cosmedcloud using OAuth protocol to manage authentication.</p>\n<p>To request a client ID and secret key please contact cosmedcloud support at <a href=\"mailto:help@cosmedcloud.com\">help@cosmedcloud.com</a></p>\n<p>Tokens are issued from a client ID and secret key and are valid for 1 hour. \n Before using the API you must request a token</p>\n","_postman_id":"2c447c84-237f-4838-a11e-b302804725b2"},{"name":"Account","item":[{"name":"#1 Retrieve account information","event":[{"listen":"test","script":{"id":"d0a9943d-21de-424b-89df-2b48572affde","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains account name\", function () {","    pm.expect(jsonData.data.common.account.id);","});","","pm.environment.set(\"Context_Clinic\", jsonData.data.common.account.clinics[0].id);"],"type":"text/javascript"}}],"id":"04fb4c04-fda3-4bd3-9301-32fd63d82667","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Account {\n    common {\n        account {\n            id\n            name\n            clinics {\n                id\n                name\n            }\n            users {\n                id\n                name\n            }\n            treatments {\n                id\n                name\n                variations {\n                    id\n                    name\n                    full_Name\n                }\n            }\n        }\n    }\n}","variables":""}},"url":"{{Host}}/graphql","description":"<p>You can search for clients via:</p>\n<ul>\n<li>Name (full or partial name)</li>\n<li>Mobile number (starting within 04)</li>\n<li>eMail address</li>\n</ul>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"f36a5c01-7c3f-4c3a-a706-fce7b1925e2c","name":"#1 Retrieve account information","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Account {\n    common {\n        account {\n            id\n            name\n            clinics {\n                id\n                name\n            }\n            users {\n                id\n                name\n            }\n            treatments {\n                id\n                name\n                variations {\n                    id\n                    name\n                    full_Name\n                }\n            }\n        }\n    }\n}","variables":""}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 09 Sep 2020 00:18:40 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"common\": {\n            \"account\": {\n                \"id\": \"account:1\",\n                \"name\": \"Test Account\",\n                \"clinics\": [\n                    {\n                        \"id\": \"clinic:1\",\n                        \"name\": \"Clinc #1\"\n                    },\n                    {\n                        \"id\": \"clinic:2\",\n                        \"name\": \"Clinc #1\"\n                    }\n                ],\n                \"users\": [\n                    {\n                        \"id\": \"user:1\",\n                        \"name\": \"User #1\"\n                    },\n                    {\n                        \"id\": \"user:2\",\n                        \"name\": \"User #2\"\n                    } \n                ],\n                \"treatments\": [\n                    {\n                        \"id\": \"treatment:8596bcdc-1d16-404e-8bce-01ed43eecb8d\",\n                        \"name\": \"Treatment #1\",\n                        \"variations\": [\n                            {\n                                \"id\": \"treatmentvariation:98699b18-0c0e-4e6b-80e1-553504d0b0a3\",\n                                \"name\": \"Treatment Variation #1\",\n                                \"full_Name\": \"Treatment #1 - Treatment\"\n                            }\n                        ]\n                    }      \n                ]\n            }\n        }\n    }\n}"}],"_postman_id":"04fb4c04-fda3-4bd3-9301-32fd63d82667"}],"id":"1a4c9583-9f66-46e0-9b1d-22bdee27a793","description":"<p>We expose key account objects to you which you can use in your application or access in GraphQL queries. These include:</p>\n<ul>\n<li>Clinics</li>\n<li>Users</li>\n<li>Treatments</li>\n</ul>\n<h2 id=\"graphql-schema\">GraphQL Schema</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>type Common {\n    # Gets the current account assoiciated with the token\n    account: Account\n}\n\ntype User implements Node {\n    id: ID\n    name: String\n    image: String\n    type: UserType\n    active: Boolean\n    eMail: String\n    allowed_Clinics: [Clinic]\n}\n\nenum UserType {\n    FRONT_DESK\n    REGISTERED_NURSE\n    SKIN_THERAPIST\n    DOCTOR\n    ACCOUNT_ADMINISTRATOR\n}\n\n\ntype Clinic implements Node {\n    id: ID\n    name: String!\n    timezone: String\n}\n\n\ntype Treatment implements Node {\n    id: ID\n    name: String\n    variations: [TreatmentVariaton]\n    description_Long: Boolean\n    description: String\n    script_Required: Boolean\n}\n\ntype TreatmentVariaton implements Node {\n    id: ID\n    name: String\n    full_Name: String\n    active: Boolean\n}\n</code></pre>","event":[{"listen":"prerequest","script":{"id":"de9586e4-5a3b-4af6-b157-201a4fbdad4e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"65845751-745f-4d3c-9235-e7ef13a95993","type":"text/javascript","exec":[""]}}],"_postman_id":"1a4c9583-9f66-46e0-9b1d-22bdee27a793"},{"name":"Clients","item":[{"name":"#1 Create/Update client","event":[{"listen":"test","script":{"id":"14bb0521-e90d-439a-acc7-11ba55ab033a","exec":["var jsonData = pm.response.json();","","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response contains client\", function () {","    pm.expect(jsonData.data.clients.updateClient.id);","});","","pm.environment.set(\"Context_PID\", jsonData.data.clients.updateClient.id);"],"type":"text/javascript"}}],"id":"dca85632-c17b-4c56-8884-0fd4e9dd8775","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"mutation CreateClient($given: String!, $surname: String!, $clinic: String!) {\n    clients {\n        updateClient(given: $given, surname: $surname, clinic: $clinic) {\n            id\n            given\n            surname\n            eMail\n            mobile\n            dOB\n        }\n    }\n}","variables":"{\n    \"clinic\": \"{{Context_Clinic}}\",\n    \"given\": \"Joe\",\n    \"surname\": \"Bloggs\"\n}"}},"url":"{{Host}}/graphql","description":"<p>This method can create or update a client. To create a new client do not pass a client ID as the ID argument.</p>\n<p>The minimum required arguments are:</p>\n<ul>\n<li>Givename</li>\n<li>Surname</li>\n<li>Clinic (the owner of the client)</li>\n</ul>\n<p>2 exmaples are provied to show both creating and updating a client.</p>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"2c140f49-4499-405d-a96f-a87f90b6e258","name":"Creating a client","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"mutation CreateClient($given: String!, $surname: String!, $clinic: String!) {\n    clients {\n        updateClient(given: $given, surname: $surname, clinic: $clinic) {\n            id\n            given\n            surname\n            eMail\n            mobile\n            dOB\n        }\n    }\n}","variables":"{\n    \"clinic\": \"clinic:1\",\n    \"given\": \"Joe\",\n    \"surname\": \"Bloggs\"\n}"}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 09 Sep 2020 02:28:41 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"clients\": {\n            \"updateClient\": {\n                \"id\": \"client:1\",\n                \"given\": \"Joe\",\n                \"surname\": \"Bloggs\",\n                \"eMail\": null,\n                \"mobile\": null,\n                \"dOB\": \"1753-01-01\"\n            }\n        }\n    }\n}"},{"id":"5d768a9a-be93-4cd8-9360-06ef181654dc","name":"Updating a client","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"mutation CreateClient($id: String!, $given: String!, $surname: String!, $clinic: String!) {\n    clients {\n        updateClient(id: $id, given: $given, surname: $surname, clinic: $clinic) {\n            id\n            given\n            surname\n            eMail\n            mobile\n            dOB\n        }\n    }\n}","variables":"{\n    \"clinic\": \"clinic:19557583\",\n    \"given\": \"Joe\",\n    \"surname\": \"Bloggs\",\n    \"id\": \"client:1360294228\"\n}"}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 09 Sep 2020 02:28:41 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"clients\": {\n            \"updateClient\": {\n                \"id\": \"client:1360294228\",\n                \"given\": \"Joe\",\n                \"surname\": \"Bloggs\",\n                \"eMail\": null,\n                \"mobile\": null,\n                \"dOB\": \"1753-01-01\"\n            }\n        }\n    }\n}"}],"_postman_id":"dca85632-c17b-4c56-8884-0fd4e9dd8775"},{"name":"#2 Retrieve client","event":[{"listen":"test","script":{"id":"114761f4-930f-4454-b05f-3f415080b970","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","var jsonData = pm.response.json();","","pm.test(\"Contains client\", function () {","    pm.expect(jsonData.data.clients.client.id).to.eql(pm.variables.get(\"Context_PID\"));","});",""],"type":"text/javascript"}}],"id":"96026de0-68e8-415e-950d-fb7cd4db4177","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Client($pid: ID) {\n    clients {\n        client(pid: $pid) {\n            id\n            given\n            surname\n            eMail\n            mobile\n            dOB\n        }\n    }\n}","variables":"{\n    \"pid\": \"{{Context_PID}}\"\n}"}},"url":"{{Host}}/graphql","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"d9b05ca2-f944-4968-9b0c-14b84f5f67e7","name":"#2 Retrieve a client","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql"},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 08 Sep 2020 23:32:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"clients\": {\n            \"client\": {\n                \"id\": \"client:1\",\n                \"given\": \"Joe\",\n                \"surname\": \"Bloggs\",\n                \"eMail\": \"joe@bloggs.com\",\n                \"mobile\": \"0400000000\",\n                \"dOB\": \"2000-01-01\"\n            }\n        }\n    }\n}"}],"_postman_id":"96026de0-68e8-415e-950d-fb7cd4db4177"},{"name":"#3 Search clients","event":[{"listen":"test","script":{"id":"78baf070-9320-474e-9174-1d63ba5342c6","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains search results\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.data.clients.searchClients);","});"],"type":"text/javascript"}}],"id":"af2ca1de-cfc9-48e1-b4d9-6d78b1f685fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query ClientSearch($term: String!) {\n    clients {\n        searchClients(term: $term) {\n            items {\n            id\n            full_Name\n            eMail\n            mobile\n            }\n        }\n    }\n}","variables":"{\n    \"term\": \"Joe Bloggs\"\n}"}},"url":"{{Host}}/graphql","description":"<p>You can search for clients via:</p>\n<ul>\n<li>Name (full or partial name)</li>\n<li>Mobile number (starting within 04)</li>\n<li>eMail address</li>\n</ul>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"e6339d5c-a551-4223-b608-48c191b5610f","name":"#1 Search for clients","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql"},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 08 Sep 2020 23:27:25 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"clients\": {\n            \"searchClients\": [\n                {\n                    \"id\": \"client:1\",\n                    \"full_Name\": \"Joe Bloggs\",\n                    \"eMail\": \"joe@bloggs.com\",\n                    \"mobile\": \"0400000000\"\n                },\n                {\n                    \"id\": \"client:2\",\n                    \"full_Name\": \"Joe Bloggs\",\n                    \"eMail\": \"joe1@bloggs.com\",\n                    \"mobile\": \"0400000000\"\n                }\n            ]\n        }\n    }\n}"}],"_postman_id":"af2ca1de-cfc9-48e1-b4d9-6d78b1f685fa"}],"id":"12c925c0-e6cb-4c18-81d1-bf67369974b9","description":"<p>You can manage your clients including:</p>\n<ul>\n<li>Searching clients</li>\n<li>Retrieving clients</li>\n<li>Creating clients</li>\n</ul>\n<p>Clients are identified by an ID named PID which is always in the form \"client:ABC\" </p>\n<h2 id=\"graphql-schema\">GraphQL Schema</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>type Clients {\n    # Fetches an object given its global Id\n    node(id: ID!): Node\n    # Retrieve a client\n    client(pid: ID): Client\n    # Searches for clients\n    searchClients(term: String, clinic: String): [Client]\n}\n\ntype Client implements Node {\n    given: String!\n    surname: String!\n    eMail: String!\n    mobile: String!\n    known_As: String!\n    middle_Name: String!\n    full_Name: String!\n    work_Phone: String!\n    home_Phone: String!\n    notes: String!\n    dOB: Date!\n    optOut_SMS: Boolean!\n    optOut_eMail: Boolean!\n    optOut_PhoneCall: Boolean!\n    optOut_Post: Boolean!\n    owner_Clinic: Int!\n    occupation: String!\n    inactive: Boolean!\n    new_Patient: Boolean!\n    duplicates: [Long!]!\n    not_Duplicates: [Long!]!\n    tags: [String]!\n    marketing_Lists: [String]!\n    id: ID\n    gender: Gender\n}\n</code></pre>","_postman_id":"12c925c0-e6cb-4c18-81d1-bf67369974b9"},{"name":"Medical Notes","item":[{"name":"#1 Create medical note","event":[{"listen":"test","script":{"id":"b808806b-8eaf-4a67-b296-3121a6f6522f","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains created note\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.data.treatments.createNote.id);","});"],"type":"text/javascript"}}],"id":"0bc515f1-befc-40b5-a02c-b6481c3107d9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"mutation CreateNote($pid: String!, $clinic: String!, $notes: String!) {\n    treatments {\n        createNote(pid: $pid, clinic: $clinic, notes: $notes) {\n            id\n            clinic {\n                id\n                name\n            }\n            notes\n            timestamp\n            user {\n                id\n                name\n            }\n        }\n    }\n}","variables":"{\n    \"pid\": \"{{Context_PID}}\",\n    \"clinic\": \"{{Context_Clinic}}\",\n    \"notes\": \"lorem ipsum\"\n}"}},"url":"{{Host}}/graphql","description":"<p>Creates a new plain text medical note for a client.</p>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"d9408c76-3c8d-4c91-bcec-b2d8f08f6f55","name":"#3 Create a medical note","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"mutation CreateNote($pid: String!, $clinic: String!, $notes: String!) {\n    treatments {\n        createNote(pid: $pid, clinic: $clinic, notes: $notes) {\n            id\n            clinic {\n                id\n                name\n            }\n            notes\n            timestamp\n            user {\n                id\n                name\n            }\n        }\n    }\n}","variables":"{\n    \"pid\": \"client:1\",\n    \"clinic\": \"clinic:1\",\n    \"notes\": \"lorem ipsum\"\n}"}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 09 Sep 2020 02:47:21 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"treatments\": {\n            \"createNote\": {\n                \"id\": \"treatmentnote:6780bd65-b50e-40dc-bf07-b355fc54e759\",\n                \"clinic\": {\n                    \"id\": \"clinic:1\",\n                    \"name\": \"Test Clinic\"\n                },\n                \"notes\": \"lorem ipsum\",\n                \"timestamp\": \"2020-09-01T02:47:21.137779Z\",\n                \"user\": {\n                    \"id\": \"user:1\",\n                    \"name\": \"Test User\"\n                }\n            }\n        }\n    }\n}"}],"_postman_id":"0bc515f1-befc-40b5-a02c-b6481c3107d9"},{"name":"#2 List clients medical notes","event":[{"listen":"test","script":{"id":"edd88f0f-897f-4ab3-bdcf-ce02a020989f","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains medical notes\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.data.treatments.treatmentNotes.length > 0);","});"],"type":"text/javascript"}}],"id":"d0cb172b-5500-4e87-b6fc-7a1bf508b097","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Client($pid: ID!) {\n    treatments {\n        treatmentNotes(pid: $pid) {\n            items {\n                                             id\n                                            timestamp \n                                            notes\n                                            notes_HTML\n                                             maps {\n                                                id\n                                                uRL\n                                                name\n                                            }\n                                            frontdesk_Notes\n                                            treatments {\n                                                treatment {\n                                                    id\n                                                    name\n                                                }\n                                                variations {\n                                                    variation {\n                                                        name\n                                                        id\n                                                    }\n                                                    qTY\n                                                }\n                                                billing {\n                                                    id\n                                                    qTY\n                                                    price\n                                                    price_Total\n                                                    is_Consumable\n                                                    billed\n                                                    invoice\n                                                    item {\n                                                        name\n                                                    }\n                                                    codes {\n                                                        qTY\n                                                        code\n                                                    }\n                                                }\n                                            }\n                                            user {\n                                                id\n                                                name\n                                            }\n                                            clinic {\n                                                id\n                                                name\n                                            } \n                                            last_Updated\n                                            edit_Count\n                                            attachments {\n                                                id\n                                                image\n                                                notes\n                                            }\n                                            created_Forms\n                                            source_Mobile\n                                            can_Edit\n                                            needs_Invoicing\n            }\n        }\n    }\n}","variables":"{\n    \"pid\": \"{{Context_PID}}\"\n}"}},"url":"{{Host}}/graphql","description":"<p>Returns a list of all medical notes saved for a client. These are the individual 'encounters' created for the client. Note see the treatment note summary endpoint for summarised treatment information.</p>\n<p><strong>Note - only the plain text notes and structured treatment information is available via the API. Injectable treatment maps are not available via the API.</strong></p>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"71149436-168f-4d5d-aa30-8bb6a26913a5","name":"#1 List the clients medical notes","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Client($pid: String) {\n    treatments {\n        treatmentNotes(pid: $pid) {\n            id\n            timestamp \n            notes\n            frontdesk_Notes\n            treatments {\n                treatment {\n                    id\n                    name\n                }\n            }\n            user {\n                id\n                name\n            }\n            clinic {\n                id\n                name\n        \n            } \n            \n        }\n    }\n}","variables":"{\n    \"pid\": \"client:1\"\n}"}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 08 Sep 2020 23:50:55 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId=cid-v1:b186cdbe-3704-4d5f-9550-8d3ad3a0c11e"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"treatments\": {\n            \"treatmentNotes\": [\n                {\n                    \"id\": \"treatmentnote:011aeb21-60dc-47ac-b3b6-e69f84b52c3c\",\n                    \"timestamp\": \"2020-08-10T00:15:53.5901019\",\n                    \"notes\": \"**MASKED**\",\n                    \"frontdesk_Notes\": \"**MASKED**\",\n                    \"treatments\": [\n                        {\n                            \"treatment\": {\n                                \"id\": \"treatment:42ddfdf9-4020-4d22-af2f-4085442240d0\",\n                                \"name\": \"Anti-Wrinkle Injections\"\n                            }\n                        },\n                        {\n                            \"treatment\": {\n                                \"id\": \"treatment:a88b9e03-8fd2-4346-8dc8-47268e5de003\",\n                                \"name\": \"Dermal Filler\"\n                            }\n                        }\n                    ],\n                    \"user\": {\n                        \"id\": \"user:1\",\n                        \"name\": \"**MASKED**\"\n                    },\n                    \"clinic\": {\n                        \"id\": \"clinic:1\",\n                        \"name\": \"**MASKED**\"\n                    }\n                } \n            ]\n        }\n    }\n}"}],"_postman_id":"d0cb172b-5500-4e87-b6fc-7a1bf508b097"},{"name":"#3 List clients summarised treatment history","event":[{"listen":"test","script":{"id":"f814054d-5373-4655-9ebd-6a4ab97ce10f","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Contains treatments summary\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.data.treatments.treatmentsSummarised);","});"],"type":"text/javascript"}}],"id":"449d81b3-4eeb-49c9-a442-554d78750692","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{OAuth_BearerToken}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Client($pid: String) {\n    treatments {\n        treatmentsSummarised(pid: $pid) {\n            id\n            treatment {\n                id\n                name\n            }\n            last_Treated_At {\n                id\n                name\n            }\n            last_Treated_By {\n                id\n                name\n            }\n            last_Treated_When\n            count\n            \n        }\n    }\n}","variables":"{\n    \"pid\": \"{{Context_PID}}\"\n}"}},"url":"{{Host}}/graphql","description":"<p>Returns a summarised list of the clients treatment history. This is useful when you want a summary of the treatments without needing to get the detail of each instance.</p>\n","urlObject":{"path":["graphql"],"host":["{{Host}}"],"query":[],"variable":[]}},"response":[{"id":"ee33c721-f997-4156-8a72-3556a7dd306a","name":"#2 List clients summarised treatment history","originalRequest":{"method":"POST","header":[],"body":{"mode":"graphql","graphql":{"query":"query Client($pid: String) {\n    treatments {\n        treatmentsSummarised(pid: $pid) {\n            id\n            treatment {\n                id\n                name\n            }\n            last_Treated_At {\n                id\n                name\n            }\n            last_Treated_By {\n                id\n                name\n            }\n            last_Treated_When\n            count\n            \n        }\n    }\n}","variables":"{\n    \"pid\": \"client:1\"\n}"}},"url":"{{Host}}/graphql"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 09 Sep 2020 02:54:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Server","value":"Kestrel"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Request-Context","value":"appId="}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"treatments\": {\n            \"treatmentsSummarised\": [\n                {\n                    \"id\": \"summarisedtreatment:696020287:42ddfdf9-4020-4d22-af2f-4085442240d0\",\n                    \"treatment\": {\n                        \"id\": \"treatment:42ddfdf9-4020-4d22-af2f-4085442240d0\",\n                        \"name\": \"Anti-Wrinkle Injections\"\n                    },\n                    \"last_Treated_At\": {\n                        \"id\": \"clinic:1\",\n                        \"name\": \"Test Clinic\"\n                    },\n                    \"last_Treated_By\": {\n                        \"id\": \"user:1\",\n                        \"name\": \"Test User\"\n                    },\n                    \"last_Treated_When\": \"2020-08-10T00:10:46Z\",\n                    \"count\": 13\n                },\n                {\n                    \"id\": \"summarisedtreatment:696020287:a88b9e03-8fd2-4346-8dc8-47268e5de003\",\n                    \"treatment\": {\n                        \"id\": \"treatment:a88b9e03-8fd2-4346-8dc8-47268e5de003\",\n                        \"name\": \"Dermal Filler\"\n                    },\n                    \"last_Treated_At\": {\n                        \"id\": \"clinic:1\",\n                        \"name\": \"Test Clinic\"\n                    },\n                    \"last_Treated_By\": {\n                        \"id\": \"user:1\",\n                        \"name\": \"Test User\"\n                    },\n                    \"last_Treated_When\": \"2020-08-10T00:10:46Z\",\n                    \"count\": 15\n                } \n            ]\n        }\n    }\n}"}],"_postman_id":"449d81b3-4eeb-49c9-a442-554d78750692"}],"id":"5e6f5a83-0642-4e79-8305-c0caa69fb9cc","description":"<p>You can retrieve and create medical notes for a client.</p>\n<h2 id=\"graphql-schema\">GraphQL Schema</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>type Treatments {\n    # Fetches an object given its global Id\n    node(id: ID!): Node\n    # Gets list of the clients treatment notes\n    treatmentNotes(pid: String): [TreatmentNote]\n    # Gets summarised list of the clients treatments\n    treatmentsSummarised(pid: String): [SummarisedTreatment]\n}\n\ntype SummarisedTreatment {\n    id: ID\n    last_Treated_When: DateTime\n    count: Int\n    treatment: Treatment\n    last_Treated_At: Clinic\n    last_Treated_By: User\n}\n\ntype TreatmentNote implements Node {\n    id: ID\n    timestamp: DateTime\n    notes: String\n    frontdesk_Notes: String\n    treatments: [TreatmentNoteTreatment]\n    user: User\n    clinic: Clinic\n    client: Client\n}\n\ntype TreatmentNoteTreatment {\n    treatment: Treatment\n    retreatment_Reminder: Boolean\n    retreatment_Reminder_InDays: Int\n    aftercare_Send: Boolean\n    aftercare_Notes: Int\n    total_QTY: Decimal\n}\n</code></pre>","_postman_id":"5e6f5a83-0642-4e79-8305-c0caa69fb9cc"}],"event":[{"listen":"prerequest","script":{"id":"ec1f1aa6-4812-441e-9779-9d922523f409","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"0fe703a9-3133-485f-8f74-c54002a34466","type":"text/javascript","exec":[""]}}]}