{"info":{"_postman_id":"ad3608db-bacf-48fa-927c-9a56f2a190d6","name":"Foxo B2B API v1","description":"<html><head></head><body><h1 id=\"integration-guide-doctor-portal\">Integration guide (Doctor portal)</h1>\n<p>This guide will advise any integrator on how to use parts of the Foxo B2B API to login/register users from their platform and do operations on their behalf.</p>\n<p>After successful authentication with the API an integrator can use their platform or application to send their users to a co-branded Foxo registration or login page to instantly connect them to the Foxo network. The process is roughly like this:</p>\n<ol>\n<li>Check if a user exists on Foxo using the <code>User Exists</code> API operation.</li>\n<li>If not send them to {{FOXO_B2B_HOST}}/register, if exists then send them to the login page at {{FOXO_B2B_HOST}}. Each page supports to trigger the co-branded UI and pre-filling values for registration or login using the location hash and keys and values separated by <code>;</code> in the URL (examples below). Note in order to show a co-branded UI the <code>integration</code> parameter is required. A <code>custom_id</code> parameter can be provided in case the API User needs to map ID's from users in their system to the Foxo Users. A optional <code>callback</code> parameter with an endpoint accepting JSON can be provided if the API User wants to track user creation in realtime.<br>* For the registration page: {{FOXO_B2B_HOST}}/register#integration=ICON;custom_id=ICON-123;email=<a href=\"mailto:user@example.com\">user@example.com</a>;last_name=Doe;first_name=John;callback=<a href=\"https://www.example.com/api/callback\">https://www.example.com/api/callback</a><br>* For the login page: {{FOXO_B2B_HOST}}#integration=ICON;custom_id=ICON-123;email=<a href=\"mailto:user@example.com\">user@example.com</a>;callback=<a href=\"https://www.example.com/api/callback\">https://www.example.com/api/callback</a></li>\n<li>Registering a user through the co-branded UI will automatically create an user to Foxo Integration with the integration provider (in this case <code>ICON</code>). The users having which have an integration setup with that provider can then be listed by the B2B API User using the <code>List integration users</code> endpoint. This will return those users <code>user_uid</code>'s beside basic profile information and their <code>custom_id</code>'s (if provided during login/registration). The <code>user_uids</code> can then be used to execute all the operations listed in <a href=\"https://github.com/foxo-tech/foxo-integration-api\">https://github.com/foxo-tech/foxo-integration-api</a> on the users behalf.</li>\n</ol>\n<h1 id=\"integration-guide-guest-chat\">Integration guide (Guest chat)</h1>\n<p>This guide provides details about how to initialise an (outbound) Foxo guest chat and allowing a user to skip the One-time Password (OTP) validation and pre-populate the chat with messages/subject step while doing so.</p>\n<p>After successful authentication with the API an integrator can use the provided details to start a Foxo guest chat with a Foxo team for a given user of their platform and pre-populate the chat as well as other information.</p>\n<p>In order to start the process, an integrator has to make an API call to the <code>Create Outbound guest case/chat</code> API endpoint and provide all necessary details. Upon successful response an access token is returned from that API endpoint. Note that a guest case token expires after first use. That means that each time a new guest chat/case has to be started a new B2B API call has to be done beforehand and the new link has to be used.</p>\n<p>The access token allows a user to sign into Foxo guest chat without having to provide an OTP (one time password). Once the login is successful the guest chat is automatically created with the parameters provided (guest chat subject and initial messages).</p>\n<p>The conditions to skip OTP validation are the following when using the outbound guest link created by the B2B API:</p>\n<p>* The user provides a new email address which has never been used with Foxo or Foxo Guest when logging in to Guest Chat<br>* The user provides an existing email address which he/she signed in with previously and the user identifier provided via B2B API either matches that email (`email` identifier) or was previously associated with that user (`session_id` / <code>user_id</code> / <code>ip_address</code> )identifiers).</p>\n<p>Foxo Guest is requiring a OTP validation if:</p>\n<p>* The user provides an existing email address and some of the user identifiers are new and never been associated with a user account yet (`session_id`, <code>user_id, ip_address</code>)<br>* The email identifier provided via B2B API endpoint does not match the email the user provides while logging in<br>* If a user is already logged in with Foxo Guest but the user identifiers embedded into the outbound link do not match that user, the user will be forced to sign out and re-do the authentication flow</p>\n<p>In either case, if the user logged in successfully the chat/case will be pre-populated with any additional details provided in the B2B API call (case subject, messages, etc).</p>\n<h1 id=\"api-documentation\">API documentation</h1>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Integration guide (Doctor portal)","slug":"integration-guide-doctor-portal"},{"content":"Integration guide (Guest chat)","slug":"integration-guide-guest-chat"},{"content":"API documentation","slug":"api-documentation"}],"owner":"15694577","collectionId":"ad3608db-bacf-48fa-927c-9a56f2a190d6","publishedId":"TzeUnoMV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-06-15T04:23:30.000Z"},"item":[{"name":"Authenticate","event":[{"listen":"test","script":{"id":"1d2898a3-c636-4154-a046-c23775485cd7","exec":["const accessToken = pm.response.json().access_token;","pm.collectionVariables.set('FOXO_B2B_ACCESS_TOKEN', accessToken);"],"type":"text/javascript"}}],"id":"108c8176-04fc-4384-9b09-af83f8111452","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"authenticate","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"key\": \"{{FOXO_B2B_API_KEY}}\", \n    \"secret\": \"{{FOXO_B2B_API_SECRET}}\"\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1","description":"<p>Authenticates the user account with the Foxo API, given correct API Key and Secret are provided. \nReturns a one-time access token in the response body's JSON, which can be used to access the other API operations. Note that for each operation a new access token has to be acquired.</p>\n<p>Responds with 400/401 access codes and error messages if the payload is incorrect.</p>\n","urlObject":{"path":["api","v1"],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"108c8176-04fc-4384-9b09-af83f8111452"},{"name":"User Exists","id":"28d34b82-aff3-4288-8f21-265b1564a25f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"user-exists","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"user@example.com\",\n    \"ahpra_no\": \"MED1234567890\",\n    \"mobile_phone\": \"0412345678\"\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1","description":"<p>Check if a user exists in the Foxo network. The <code>email</code>, <code>ahpra_no</code> or <code>mobile_phone</code> can be provided in the request body to check for user existence. \nWill return <code>true</code> or <code>false</code> in the <code>data</code> property of the JSON response based on if the user exists or not.</p>\n","urlObject":{"path":["api","v1"],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"28d34b82-aff3-4288-8f21-265b1564a25f"},{"name":"List integration users","event":[{"listen":"test","script":{"id":"d343a0b2-62c1-4e93-b80b-57fdec7a0b2c","exec":["let jsonData = JSON.parse(responseBody);","pm.collectionVariables.set(\"FOXO_B2B_userUidWithIntegration\", jsonData.data[0].user_uid);"],"type":"text/javascript"}}],"id":"6abaebdd-7372-45a0-bca2-0ca2cb726681","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"list-integration-users","type":"text"}],"url":"{{FOXO_B2B_HOST}}/api/v1","description":"<p>List users which have an integration setup with the API Users integration pattern. This means that if the API User is setup to handle integrations with <code>ICON</code> the endpoint's response will list users which have an <code>ICON</code> integration on setup with their user account. It won't list other users with other integration types.</p>\n<p>The response will return an array of users in the <code>data</code> property of the JSON response and expose <code>user_uid</code>, <code>email</code>, <code>last_name</code> and <code>first_name</code> of that user. The <code>user_uid</code> can be used for all the request following which use their integration endpoints on their behalf.</p>\n","urlObject":{"path":["api","v1"],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6abaebdd-7372-45a0-bca2-0ca2cb726681"},{"name":"Search teams","event":[{"listen":"test","script":{"id":"d343a0b2-62c1-4e93-b80b-57fdec7a0b2c","exec":[""],"type":"text/javascript"}}],"id":"db284aa2-5874-4828-8f8c-d2f85de7d5da","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"search-teams","type":"text"}],"url":"{{FOXO_B2B_HOST}}/api/v1?searchText=test","description":"<p>Allows search for Foxo teams which are public in the Foxo platform. A searchText query parameter has to be provided with a text to search for.</p>\n<p>The response will return an array of teams in the <code>data</code> property of the JSON response and expose <code>team_uid</code>, <code>name</code> and <code>description</code> of that team (to be extended). The <code>team_uid</code> can be used to pass as parameters into other requests.</p>\n","urlObject":{"path":["api","v1"],"host":["{{FOXO_B2B_HOST}}"],"query":[{"key":"searchText","value":"test"}],"variable":[]}},"response":[],"_postman_id":"db284aa2-5874-4828-8f8c-d2f85de7d5da"},{"name":"Create outbound guest case/chat","event":[{"listen":"test","script":{"id":"d343a0b2-62c1-4e93-b80b-57fdec7a0b2c","exec":[""],"type":"text/javascript"}}],"id":"2f20e23f-e598-466a-806f-003018c8a0a2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"create-outbound-guest-case","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"team_uid\": \"0d4c9142-989d-4ed1-b34e-eebb1e7c3597\",\n    \"user_identifiers\": {\n        \"session_id\": \"vbj12kQesNmhKyNCC7tSGtut70f7UcBr\",\n        \"user_id\": \"1234\",\n        \"email\": \"user@example.com\",\n        \"ip_address\": \"111.40.126.168\"\n    },\n    \"subject\": \"Scans for patient\",\n    \"messages\": [\n        \"Patient name: John Doe\",\n        \"Patient DOB: 01/01/1970\",\n        \"Patient Medicare Number: 123456789 1\",\n        \"Please have a look at these scans\"\n    ]\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1","description":"<p>Initializes an (outbound) guest case chat on behalf of a user. A JSON object has to be provided in the request body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"team_uid\": \"Required, the Foxo team_uid of the guest chat. The team_uid can be extracted from the guest chat link URL\",\n    \"user_identifiers\": {\n        // Information about the users identity associated with the integrators platform to uniquely identify them with Foxo Guest\n        // At least one of the following has to be provided.\n        \"session_id\": \"A session ID of the user logged in with the integrators platform\"\n        \"user_id\": \"A user ID of the user logged in with the integrators platform\",\n        \"email\": \"Email address of the user logged in with the integrators platform\",\n        \"ip_address\": \"The IP address the user used in the integrators platform\"\n    },\n    \"subject\": \"Required subject of the newly created guest case\",\n    \"messages\": [\n        // Optional, an array of strings which will be created as first messages in the newly created guest chat\n    ]\n}\n\n</code></pre>\n<p>The response will return a JSON object in the response body, containing an <code>access_token</code> which can be appended to a Foxo Guest chat URL via query string parameter <code>?guest_outbound_token=...</code></p>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Outbound guest token\",\n    \"data\": {\n        \"guest_outbound_token\": \"qkjl7pl3iltdbx\",\n        \"guest_case_link\": \"{{FOXO_GUEST_HOST}}/chat/0d4c9142-989d-4ed1-b34e-eebb1e7c3597/new?guest_outbound_token=7y2l7pu52rxkcn\"\n    }\n}\n\n</code></pre>\n","urlObject":{"path":["api","v1"],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2f20e23f-e598-466a-806f-003018c8a0a2"},{"name":"User Integration: Add Patient","event":[{"listen":"test","script":{"id":"f769cd52-55a6-47fa-9151-b5463b083023","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"6de57eab-20b5-4b90-a1fb-6e40e1a4f3c9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"X-Foxo-Action","value":"create-patient","type":"text"}],"body":{"mode":"raw","raw":"{\n  \"Title\": \"Ms\",\n  \"GivenName\": \"{{First Name}}\",\n  \"FamilyName\": \"{{Last Name}}\",\n  \"OtherNames\": null,\n  \"DateOfBirth\": \"1980-01-01T00:00:00.0000000\",\n  \"Sex\": \"Female\",\n  \"HomePhone\": \"0812344321\",\n  \"WorkPhone\": null,\n  \"MobilePhone\": null,\n  \"EmailAddress\": null,\n  \"Location\": \"123 fake street\",\n  \"Suburb\": \"Osborne Park\",\n  \"PostCode\": \"6017\",\n  \"State\": \"WA\",\n  \"Country\": \"Australia\",\n\n \n  \"[a-z0-9]*Identifier\": \"1234\",\n\n  \n  \"KarismaIdentifierType\": \"Internal\",\n  \"WorkSiteIdentifierType\": \"Logan UR\",\n  \"Identifiers\": [\n      {\n          \"Type\": \"Logan UR\",\n          \"Value\": \"1234\"\n      },\n      {\n          \"Type\": \"Redlands UR\",\n          \"Value\": \"4321\"\n      },\n      {\n          \"Type\": \"Internal\",\n          \"Value\": \"5678\"\n      },\n      {\n          \"TypeN\": \"Name\",\n          \"ValueN\": \"Value\"\n      }\n  ]\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same endpoint <a href=\"https://github.com/foxo-tech/foxo-integration-api#create-patient\">https://github.com/foxo-tech/foxo-integration-api#create-patient</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint.</p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6de57eab-20b5-4b90-a1fb-6e40e1a4f3c9"},{"name":"User Integration: Get Teams","event":[{"listen":"test","script":{"id":"42b2defe-22ed-4226-b855-81300f044711","exec":["var jsonData = JSON.parse(responseBody);\r","if (jsonData.data[0]) {\r","    pm.collectionVariables.set(\"FOXO_B2B_team_uid1\", jsonData.data[0].team_uid);\r","}\r","if (jsonData.data[1]) {\r","    pm.collectionVariables.set(\"FOXO_B2B_team_uid2\", jsonData.data[1].team_uid);\r","}\r",""],"type":"text/javascript"}}],"id":"eecb8b9f-073c-421b-851f-9e6aedc11bfd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[{"key":"X-Foxo-Action","value":"list-teams","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#list-available-teams\">https://github.com/foxo-tech/foxo-integration-api#list-available-teams</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint.</p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"eecb8b9f-073c-421b-851f-9e6aedc11bfd"},{"name":"User Integration: Add Patient + Send Case (with subject and message)","event":[{"listen":"test","script":{"id":"2b0c11c5-1554-44eb-a403-fe19684c1924","exec":["let jsonData = JSON.parse(responseBody);\r","console.log(jsonData);\r","pm.collectionVariables.set(\"FOXO_B2B_patientWithCaseSubjectAndMessage\", jsonData.patient_uid);\r","console.log(pm.collectionVariables.get(\"FOXO_B2B_patientWithCaseSubjectAndMessage\"));\r","\r","jsonData = JSON.parse(responseBody);\r","pm.collectionVariables.set(\"FOXO_B2B_caseKey\", jsonData.case_Key);"],"type":"text/javascript"}}],"id":"0381792d-ef86-4c3c-81d3-75f886b0f8d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-Foxo-Action","type":"text","value":"create-patient"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"Title\":null,\n    \"GivenName\": \"{{First Name}}\",\n    \"FamilyName\": \"{{Last Name}}\",\n\t\"DateOfBirth\":\"2018-11-24T00:00:00.0000000\",\n\t\"Sex\":\"Female\",\n\t\"Location\":null,\n\t\"Suburb\":null,\n\t\"PostCode\":null,\n\t\"State\":null,\n\t\"sendToTeam\": {\n\t    \"team_uid\":\"\",\n\t    \"case_subject\": \"{{case_subject}}\",\n\t    \"case_message\": \"{{case_message}}\"\n\t  }\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#create-patient\">https://github.com/foxo-tech/foxo-integration-api#create-patient</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint. </p>\n<p><strong>WARNING: This request will only work if the users integration is setup with teams within the Foxo app, so make sure this is the case.</strong></p>\n<p><strong>WARNING: The Postman request is using a collection variable for the team_uid (<code>team_uid1</code>) to create a case for while the patient is created. The collection variable is set when executing the <code>User Integration: Get Teams</code>.</strong></p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0381792d-ef86-4c3c-81d3-75f886b0f8d5"},{"name":"User Integration: Add Patient + Send Case Multi Teams","event":[{"listen":"test","script":{"id":"d8764852-6aaa-438d-b172-21d655fd30fe","exec":["let jsonData = JSON.parse(responseBody);\r","pm.collectionVariables.set(\"FOXO_B2B_patientWithCaseToMultiTeams\", jsonData.patient_uid);\r","\r","jsonData = JSON.parse(responseBody);\r","pm.collectionVariables.set(\"FOXO_B2B_caseKey1\", jsonData.case_Keys[0]);"],"type":"text/javascript"}}],"id":"f2e7f21b-fed2-484f-b40e-42a0b424d9d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-Foxo-Action","type":"text","value":"create-patient"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"Title\":null,\n \"GivenName\": \"{{First Name}}\",\n  \"FamilyName\": \"{{Last Name}}\",\n\t\"DateOfBirth\":\"2018-11-24T00:00:00.0000000\",\n\t\"Sex\":\"Female\",\n\t\"Location\":null,\n\t\"Suburb\":null,\n\t\"PostCode\":null,\n\t\"State\":null,\n\t\"sendToTeam\": {\n\t    \"team_uids\": [\"\", \"\"],\n\t    \"case_subject\": \"{{case_subject}}\",\n\t    \"case_message\": \"{{case_message}}\"\n\t  }\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#create-patient\">https://github.com/foxo-tech/foxo-integration-api#create-patient</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint. </p>\n<p><strong>WARNING: This request will only work if the users integration is setup with teams within the Foxo app, so make sure this is the case.</strong></p>\n<p><strong>WARNING: The Postman request is using a collection variable for the team_uid's (<code>team_uid1</code> &amp; <code>team_uid2</code>) to create a case for while the patient is created. The collection variables are set when executing the <code>User Integration: Get Teams</code>.</strong></p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f2e7f21b-fed2-484f-b40e-42a0b424d9d8"},{"name":"User Integration: Add Patient + Send Case (with subject only)","event":[{"listen":"test","script":{"id":"00b4bc38-0217-4906-8618-2d01d154b59d","exec":["let jsonData = JSON.parse(responseBody);\r","pm.collectionVariables.set(\"FOXO_B2B_patientWithCaseSubjectOnly\", jsonData.patient_uid);\r","\r","jsonData = JSON.parse(responseBody);\r","pm.collectionVariables.set(\"FOXO_B2B_caseKey2\", jsonData.case_Key);"],"type":"text/javascript"}}],"id":"d4377b15-3725-43be-a4d9-b4807832608b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-Foxo-Action","type":"text","value":"create-patient"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"Title\":null,\n \"GivenName\": \"{{First Name}}\",\n  \"FamilyName\": \"{{Last Name}}\",\n\t\"DateOfBirth\":\"2018-11-24T00:00:00.0000000\",\n\t\"Sex\":\"Female\",\n\t\"Location\":null,\n\t\"Suburb\":null,\n\t\"PostCode\":null,\n\t\"State\":null,\n\t\"sendToTeam\": {\n\t\t    \"team_uid\":\"\",\n\t    \"case_subject\": \"{{case_subject}}\",\n\t    \"case_message\": \" \"\n\t  }\n}"},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#create-patient\">https://github.com/foxo-tech/foxo-integration-api#create-patient</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint. </p>\n<p><strong>WARNING: This request will only work if the users integration is setup with teams within the Foxo app, so make sure this is the case.</strong></p>\n<p><strong>WARNING: The Postman request is using a collection variable for the team_uid (<code>team_uid1</code>) to create a case for while the patient is created. The collection variable is set when executing the <code>User Integration: Get Teams</code>.</strong></p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d4377b15-3725-43be-a4d9-b4807832608b"},{"name":"User Integration: Add Media to patient","event":[{"listen":"test","script":{"id":"7eb5f904-5e30-4ad6-a691-10acdbd3521e","exec":["pm.test(\"Body matches string\", function () {\r","    pm.expect(pm.response.text()).to.include(\"Upload Success\");\r","});"],"type":"text/javascript"}}],"id":"3d9e696f-d299-46b7-8ed7-8342cfd10c56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-Foxo-Action","value":"upload-media","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"media","type":"file","src":"/C:/Users/Shivani/Documents/Apello/sample pics/upload files/image.jpg"},{"key":"patient_uid","value":"","type":"text"}]},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#upload-and-attach-media\">https://github.com/foxo-tech/foxo-integration-api#upload-and-attach-media</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order tp use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint.</p>\n<p><strong>WARNING: The Postman request is using a collection variable for the patient_uid (<code>patientWithCaseSubjectAndMessage</code>) to attach the media to the patient. The collection variable is set when executing the <code>User Integration: Add Patient + Send Case (with subject and message)</code>.</strong></p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d9e696f-d299-46b7-8ed7-8342cfd10c56"},{"name":"User Integration: Add Media to case thread","event":[{"listen":"test","script":{"id":"99752e92-516c-4c8b-a1d1-d7d8e5071897","exec":["pm.test(\"Body matches string\", function () {\r","    pm.expect(pm.response.text()).to.include(\"Upload Success\");\r","});"],"type":"text/javascript"}}],"id":"2d9e4bf4-5eb7-4507-baef-47321eb252e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-Foxo-Action","type":"text","value":"upload-media"}],"body":{"mode":"formdata","formdata":[{"key":"media","type":"file","src":["/Users/torsten/Pictures/Emojis/nyancat_big.gif","/Users/torsten/Pictures/Emojis/party_parrot.gif"]},{"key":"case_key","value":"","type":"text"}]},"url":"{{FOXO_B2B_HOST}}/api/v1/","description":"<p>Same end <a href=\"https://github.com/foxo-tech/foxo-integration-api#upload-and-attach-media\">https://github.com/foxo-tech/foxo-integration-api#upload-and-attach-media</a>, except the users endpoint is not called directly. Instead the API User has to first authenticate through the B2B API and then call this endpoint with a valid <code>user_uid</code> as part of the URL.</p>\n<p>This is using the users integration endpoint on their behalf.</p>\n<p>NOTE: In order to use this endpoint with Postman the <code>USER_UID</code> has to be setup in Postman environment variables or can be copied directly into the URL of this request after the {{FOXO_B2B_HOST}}/api/v1/ part. E.g. {{FOXO_B2B_HOST}}/api/v1/032d931c-9228-490c-bf7b-37de4c005520. Note also that the <code>USER_UID</code> has to be a valid <code>user_uid</code> from a user listed in the response of the <code>List integration users</code> endpoint. </p>\n<p><strong>WARNING: The Postman request is using a collection variable for the case_key (<code>caseKey</code>) to attach the media to the case. The collection variable is set when executing the <code>User Integration: Add Patient + Send Case (with subject and message)</code>.</strong></p>\n","urlObject":{"path":["api","v1",""],"host":["{{FOXO_B2B_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2d9e4bf4-5eb7-4507-baef-47321eb252e2"}],"event":[{"listen":"prerequest","script":{"id":"b54a3a6d-023f-478d-8c60-595a517d7f6c","type":"text/javascript","exec":["if (pm.request.headers.get('X-Foxo-Action').toLowerCase() === 'authenticate') {","    return;","}","","pm.sendRequest({","    url: pm.environment.get('FOXO_B2B_HOST') + '/api/v1',","    method: 'POST',","    header: {","        'Content-Type': 'application/json',","        'X-Foxo-Action': 'authenticate'","    },","    body: JSON.stringify({","        key: pm.environment.get('FOXO_B2B_API_KEY'),","        secret: pm.environment.get('FOXO_B2B_API_SECRET')","    })","}, function (err, res) {","    const accessToken = res.json().access_token;","    pm.collectionVariables.set('FOXO_B2B_ACCESS_TOKEN', accessToken);","})"]}},{"listen":"test","script":{"id":"5bfdb078-f7b7-4f41-9846-1c275c415f78","type":"text/javascript","exec":[""]}}],"variable":[{"key":"ACCESS_TOKEN","value":""},{"key":"FOXO_B2B_ACCESS_TOKEN","value":""},{"key":"FOXO_B2B_userUidWithIntegration","value":""},{"key":"FOXO_B2B_caseKey","value":""},{"key":"FOXO_B2B_team_uid1","value":""},{"key":"FOXO_B2B_team_uid2","value":""},{"key":"FOXO_B2B_patientWithCaseSubjectOnly","value":""},{"key":"FOXO_B2B_caseKey2","value":""},{"key":"FOXO_B2B_patientWithCaseSubjectAndMessage","value":""},{"key":"FOXO_B2B_patientWithCaseToMultiTeams","value":""},{"key":"FOXO_B2B_caseKey1","value":""}]}