{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"ad3608db-bacf-48fa-927c-9a56f2a190d6","name":"Foxo B2B API v1","description":"# Integration guide (Doctor portal)\n\nThis 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.\n\nAfter 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:\n\n1.  Check if a user exists on Foxo using the `User Exists` API operation.\n2.  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 `;` in the URL (examples below). Note in order to show a co-branded UI the `integration` parameter is required. A `custom_id` 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 `callback` parameter with an endpoint accepting JSON can be provided if the API User wants to track user creation in realtime.  \n    \\* For the registration page: {{FOXO_B2B_HOST}}/register#integration=ICON;custom_id=ICON-123;email=user@example.com;last_name=Doe;first_name=John;callback=[https://www.example.com/api/callback](https://www.example.com/api/callback)  \n    \\* For the login page: {{FOXO_B2B_HOST}}#integration=ICON;custom_id=ICON-123;email=user@example.com;callback=[https://www.example.com/api/callback](https://www.example.com/api/callback)\n3.  Registering a user through the co-branded UI will automatically create an user to Foxo Integration with the integration provider (in this case `ICON`). The users having which have an integration setup with that provider can then be listed by the B2B API User using the `List integration users` endpoint. This will return those users `user_uid`'s beside basic profile information and their `custom_id`'s (if provided during login/registration). The `user_uids` can then be used to execute all the operations listed in [https://github.com/foxo-tech/foxo-integration-api](https://github.com/foxo-tech/foxo-integration-api) on the users behalf.\n    \n\n# Integration guide (Guest chat)\n\nThis 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.\n\nAfter 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.\n\nIn order to start the process, an integrator has to make an API call to the `Create Outbound guest case/chat` 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.\n\nThe 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).\n\nThe conditions to skip OTP validation are the following when using the outbound guest link created by the B2B API:\n\n\\* The user provides a new email address which has never been used with Foxo or Foxo Guest when logging in to Guest Chat  \n\\* 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\\` / `user_id` / `ip_address` )identifiers).\n\nFoxo Guest is requiring a OTP validation if:\n\n\\* 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\\`, `user_id, ip_address`)  \n\\* The email identifier provided via B2B API endpoint does not match the email the user provides while logging in  \n\\* 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\n\nIn 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).\n\n# API documentation","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"15694577","team":1934975,"collectionId":"ad3608db-bacf-48fa-927c-9a56f2a190d6","publishedId":"TzeUnoMV","public":true,"publicUrl":"https://documenter-api.postman.tech/view/15694577/TzeUnoMV","privateUrl":"https://go.postman.co/documentation/15694577-ad3608db-bacf-48fa-927c-9a56f2a190d6","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.11.6","publishDate":"2021-06-15T04:23:30.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/32e1622d039c22c34c2e160383fa506673974b6ed77b2a79eeb807ddad8ab31f","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/TzeUnoMV"}