Login

For most of the Bricks Switchboard API calls the user needs to be loggedin. Here you can find information how to create a session and how to end it.

Hint

For each request on this page you need to add identication data. More information about this can be found in Identification / access chapter.

For authorization the following steps need to be completed:

Step 1: Create a session with username and password.

The username and password are created in Bricks Huisarts by the practice.

Request

{
  "Name": "{{name}}",
  "Key": "{{key}}",
  "Target": "{{target}}",
  "Session": "{{session}}",
  "Method": "Login",
  "username": "mail@example.com",
  "password": "this-is-the-password-of-the-user"
}

Warning

Your application needs to create a session value, Bricks Switchboard isn’t creating sessions! If you want you can use the same session ID of your application.

Keep in mind that the session ID you create needs to be very strong and cannot be guessed easily.

<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_CreateSession_Verzoek xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1000">
  <Identificatie Id="-1000" />
  <Username>e@mail.nl</Username>
  <Password>123</Password>
</Tetra_Switchboard_Security_CreateSession_Verzoek>

Response

{
  "ReturnValue": {
      "ResponseCode": 200,
      "ResponseText": "OK",
      "Melding": "Ingelogd",
      "Gelukt": true
  }
}
<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_CreateSession_Antwoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1000">
  <CommunicatieStatus>OZB_Communicatie_Status_Verzoek_is_geslaagd</CommunicatieStatus>
  <SessionId>e5ce2cd9-bc8a-463d-9dbd-3c239e2e8604</SessionId>
</Tetra_Switchboard_Security_CreateSession_Antwoord>

Next step
+++++++++
After this, the SessionId should be stored and should be used for all further patient communication.

Step 2: Send an SMS

The text message will be send by the Tetra B.V. servers.

Request

{
  "Name": "{{name}}",
  "Key": "{{key}}",
  "Target": "{{target}}",
  "Session": "{{session}}",
  "Method": "Request2FASMS"
}
<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_StuurSMS_Verzoek xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1001">
  <Identificatie xsi:type="OZB_Communicatie_Identificatie_GebruikerSessie" Id="-1001">
    <Sessie>e5ce2cd9-bc8a-463d-9dbd-3c239e2e8604</Sessie>
  </Identificatie>
  <ZenderIP />
  <OntvangerEntiteit />
</Tetra_Switchboard_Security_StuurSMS_Verzoek>

Response

{
  "ReturnValue": {
    "ResponseCode": 200,
    "ResponseText": "OK",
    "Melding": "SMS verstuurd",
    "Gelukt": true
  }
}
<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_StuurSMS_Antwoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1000">
  <CommunicatieStatus>OZB_Communicatie_Status_Verzoek_is_geslaagd</CommunicatieStatus>
</Tetra_Switchboard_Security_StuurSMS_Antwoord>

Step 3: Upgrade session with the verification code

Send the verfication code that the user received on his mobile to the Bricks Switchboard API.

Request

{
  "Name": "{{name}}",
  "Key": "{{key}}",
  "Target": "{{target}}",
  "Session": "{{sesson}}",
  "Method": "Upgrade2FASMS",
  "sms": "12345"
}
<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_SMSAntwoord_Verzoek xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1001">
  <Identificatie xsi:type="OZB_Communicatie_Identificatie_GebruikerSessie" Id="-1001">
    <Sessie>e5ce2cd9-bc8a-463d-9dbd-3c239e2e8604</Sessie>
  </Identificatie>
  <ZenderIP />
  <OntvangerEntiteit />
  <SMS>yuk123</SMS>
</Tetra_Switchboard_Security_SMSAntwoord_Verzoek>

Response

{
  "ReturnValue": {
    "ResponseCode": 200,
    "ResponseText": "OK",
    "Melding": "OK",
    "Gelukt": true
  }
}
<?xml version="1.0" encoding="utf-16"?>
<Tetra_Switchboard_Security_SMSAntwoord_Antwoord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Id="-1000">
  <CommunicatieStatus>OZB_Communicatie_Status_Verzoek_is_geslaagd</CommunicatieStatus>
</Tetra_Switchboard_Security_SMSAntwoord_Antwoord>