Navbar
Logo
  • Lexly API
  • Overview
  • Quick Start
  • Introduction
  • Authentication
  • Enable single sign-on
  • Errors
  • List of API Calls
  • Get
  • Post
  • Put
  • Delete
  • Implementation example
  • Lexly API

    General Information

    Version 1.7.2

    Schemes

    https

    Host & base path

    {customer_site}/api/v1/

    Terms of Service

    In using this API you agree to be bound by our Terms of Service

    OpenAPI specification

    OpenAPI specification for partly of this APIs can be accessible here: http://apidocs.lexly.com/v1/swagger.yaml

    Overview

    The Lexly API uses HTTPS methods and RESTful endpoints to create, edit, and manage meetings with lawyers at a customer site. JSON is the data interchange format, but we also use query parameters.

    The API is accessed through a versioned URL. This allows users to clearly identify which API they are using, and to make it easier to upgrade to any newer versions. It also avoids having to use version codes in HTTP headers.

    Any breaking changes to the API will be introduced through a new version number. We aim to keep these changes to a minimum, and when we do so, will support the current API until it is phased out.

    Changelog

    We will list any changes to the current version of the API here.

    Date Details of changes
    2023-07-06 API Version 1.7.2 was released. Adding Accept-Language support for POST/GET partnerform.
    2023-06-30 API Version 1.7.1 was released. Some updates and corrections of the partnerform documentation.
    2023-04-20 API Version 1.7.0 was released. An update of GET contact is launched and support for JWT.
    2022-08-30 API Version 1.6.2 was released. An update of GET partnerform is launched
    2022-07-15 API Version 1.6.1 was released. A new function for sending partner lead has been added. GET/POST partnerform
    2022-06-13 API Version 1.5.16 was released. A minor update to instantly send out an authorization link when a customer tries to register a new account for an email address that already exists.
    2022-05-12 API Version 1.5.15 launched. Possibility to send partner_id to meeting/free added.
    2021-10-20 API Version 1.5.14 launched. New functions are added in BankID upgrade.
    2021-07-14 API Version 1.5.13 launched. New GET and POST functions added for dynamic contact forms.
    2021-01-25 API Version 1.5.12 launched. Possibility for booking video meeting added. Updated implementation example - implementation of online meeting booking added. Stirling Blue as a brand was replaced with Lexly.
    2021-01-22 API Version 1.5.11 launched. Small bug fixes with partnerform and meeting.
    2020-12-23 API Version 1.5.10 launched. Adding a function to post partner leads (partnerform).
    2020-10-14 API Version 1.5.9 launched. An implementation example has been added.
    2020-09-10 API Version 1.5.8 launched. Smaller updates of agreements API.
    2020-05-19 API Version 1.5.7 launched. Adding a function to get subscriptions for business services.
    2020-05-12 API Version 1.5.6 launched. Adding function upgradeToBankIdVerificationMail and authenticateBankIdUpgrade.
    2020-05-06 API Version 1.5.5 launched. Adding company and getCompanyInfo.
    2020-04-02 API Version 1.5.4 launched. Adding getSessionId, possibility to register a new BankID user and update SSN at customer update.
    2020-02-06 API Version 1.5.3 launched. Possibility to reset a users password and same new fileinfo added for users.
    2020-01-31 API Version 1.5.2 launched. Possibility to subscribe to newsletters.
    2020-01-29 API Version 1.5.1 launched. Possibility to delete documents owned by the customer who has logged in.
    2020-01-28 API Version 1.5.0 launched. Support for posting and getting agreement flows has been added.
    2020-01-16 API Version 1.4.4 launched. Possibility to login with BankID added.
    2020-01-08 API Version 1.4.3 launched. Small updates of the pricelist.
    2019-11-20 API Version 1.4.2 launched. Possibility to get a priclist for current products.
    2019-11-18 API Version 1.4.1 launched. Possibility to update user info (PUT for user).
    2019-11-15 API Version 1.4 launched. Some changes regarding oauth is done as possibilities to create a new user directly on the login process.
    2019-05-07 API Version 1.3 launched. Some new functionalities added and Partner Oauth Credentials authorisation. Possibility to register a new customer via API.
    2019-04-30 API Version 1.2 launched. Some new functionalities added and OAuth authorisation (Partner Oauth Credentials, CID).
    2019-02-20 API Version 1 launched

    Quick Start

    To get started using our API it is recommended to first read the Introduction, this will give you an overview of some key concepts in use by the Lexly system.

    Introduction

    Lexlys API is a system for identifying clients, booking meetings with lawyers and receiving customer information and conveying purchased contracts.

    Authentication

    Partner Access Credentials

    Auth Workflow using cURL

    Here we provide some examples using the cURL command.

    1. Authorization for via cURL:

    $ curl 'https://${host}/api/v1/${api}' \
          -H 'Auth: user=${username},password=${password},partner=${partner_id}

    Instead of OAuth, partners can access certain APIs with authentication based on relayed login information.

    You as a partner can get the authorization information. Once you have it, you can access the APIs by sending the authorization information in the header regardless of whether you are using POST or GET. It should be written in the following format:

    Auth: user=${username},password=${password},partner=${partner_id}

    The following APIs can be accessed in this way:

    GET /api/v1/company/{organisation_number}

    GET /api/v1/contactform

    GET /api/v1/getcompanyinfo/{organisation_number}

    GET /api/v1/deals

    GET /api/v1/getsessionid

    GET /api/v1/meeting/{date}/{dealid}

    GET /api/v1/partnerform

    GET /api/v1/pricelist

    GET /api/v1/subscrption

    POST /api/v1/company

    POST /api/v1/contactform

    POST /api/v1/meeting

    POST /api/v1/partnerform

    POST /api/v1/user

    POST /api/v1/reset

    POST /api/v1/subscribe

    POST /api/v1/upgradeToBankIdVerificationMail

    POST /api/v1/authenticateBankIdUpgrade

    PUT /api/v1/reset

    Partner Oauth Credentials

    Auth Workflow using cURL

    Here we provide an examples using the cURL command.

    1. Get authorization token via cURL:

    $ curl 'https://${host}/api/v1/oauth/token' \
          -u '${partner_username}:${partner_password}' -d 'grant_type=client_credentials&email=${client_email}&password=${client_password}'

    You should now be able to perform an API call with the access_token or jwt you received above, for example:

    $  curl 'https://${host}/api/v1/user' \
          -H 'Authorization: Bearer 929a7c3cffbb0c03a87dec5153efb310a983f360'
        

    As a partner you can gain access to user information by either sending a request with a username (e-mail address) and password or with a personal identity number (ssn - for this you must write a personal identity number - example 197702190485 ). If the request is approved, you will receive an oauth access token that can be used to access all APIs. To be able to login with just the personal identity number you need a special access and a BankID login on your side of the setup or use the BankID on our side - see below.

    The Curl request should be in one of the following two formats depending on the type of request:

    • curl 'https://${host}/api/v1/oauth/token' -u '${partner_username}:${partner_password}' -d 'grant_type=client_credentials&email=${client_email}&password=${client_password}'
    • curl 'https://${host}/api/v1/oauth/token' -u '${partner_username}:${partner_password}' -d 'grant_type=client_credentials&ssn=${client_personal_identity_number}'

    You can also do a combination request with both email/password and personal identity number at the same time. In this case it will first test the email/password combination and then the personal identity number (just for partners with special access):

    • curl 'https://${host}/api/v1/oauth/token' -u '${partner_username}:${partner_password}' -d 'grant_type=client_credentials&email=${client_email}&password=${client_password}&ssn=${client_personal_identity_number}'

    When a token has expired you can request for a new one by sending the "refresh_token" as follow:

    • curl 'https://${host}/api/v1/oauth/token' -u '${partner_username}:${partner_password}' -d 'grant_type=refresh_token&refresh_token=${refresh_token}'

    You can include the following parameters

    If all are included a new user will be created if no existing one is found.

    Parameter Description Type In

    grant_type

    Required and should have the value: client_credentials

    string
    client_credentials

    Form Data

    email
    required

    The email for the user.

    string
    xxxxx@yyyy.xx

    Form Data

    ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Form Data

    phone

    The phonenumber to the customer.

    string
    only numbers

    Form Data

    first_name

    The first name of the customer.

    string
    application/json

    Form Data

    last_name

    The last name of the customer.

    string
    application/json

    Form Data

    deal_id

    Without this the customer willn't get the partner deals.

    integer
    int64

    Form Data

    password
    Not required for creating a new account

    The login password for the account.

    string

    Form Data

    Responses

    Code Description
    200

    Login ok and a token is returned.

    201

    A new user is registered, login ok and a token is returned.

    400

    One or more required fields are missing or are incorrect.

    401

    The user exist, please login with password (invalid_password).

    401

    The user exist, please login with bankid (missing_bankid).

    401

    An error with the auth credentials or the credentials may not have sufficient privileges (invalid_grant).

    403

    Auth credentials are invalid or they may not have sufficient privileges (invalid_grant).

    404

    User does not exists or can't be found with the given parameters (user_does_not_exists).

    Here we provide an examples using the cURL command for BankID login.

    1. Get orderRef and activate the BankID login via cURL:

    $ curl 'https://${host}/api/v1/oauth/bankid' \
          -u '${partner_username}:${partner_password}' -d 'bankid=${client_personal_identity_number}'

    2. Check if BankID verification is done via cURL:

    $ curl 'https://${host}/api/v1/oauth/bankid' \
          -u '${partner_username}:${partner_password}' -d 'orderRef=${orderRef}'

    When the BankID is verified by the user you should be able to perform an API call with the access_token or jwt you received above, for example:

    $  curl 'https://${host}/api/v1/user' \
          -H 'Authorization: Bearer 929a7c3cffbb0c03a87dec5153efb310a983f360'
        

    BankID login

    If you do not have special access and would like to let the end user login with bankid you can do it this way:

    • curl 'https://${host}/api/v1/oauth/bankid' -u '${partner_username}:${partner_password}' -d 'bankid=${client_personal_identity_number}'

    To check the BankID login status do as follow. The orderRef you will get as a result from the request above if the client_personal_identity_number is correct and the requester is valid to login:

    • curl 'https://${host}/api/v1/oauth/bankid' -u '${partner_username}:${partner_password}' -d 'orderRef=${orderRef}'

    The response from the request above will either be "status": "pending" or the token.

    You can include the following parameters

    If all are included a new user will be created if no existing one is found.

    Parameter Description Type In

    bankid
    one of the following is required

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Form Data

    orderRef
    one of the following is required

    A orderRef you receive from the firest request with the bankid.

    string
    a886a9c8-3036-491c-8b8a-668261b5e754

    Form Data

    Responses

    Code Description
    200

    If bankid is sent you will get the orderRef.

    200

    If orderRef is sent you will either get the "status": "pending" or the granted token.

    400

    One or more required fields are missing or are incorrect.

    401

    The user exist, please login with password (missing_password).

    404

    User does not exists or can't be found with the given parameters (invalid_grant).

    The following APIs can be accessed in this way:

    GET /api/v1/account/{id}

    GET /api/v1/agreement/{agreement_id}

    GET /api/v1/contactform

    GET /api/v1/document/{file_id}

    GET /api/v1/getsessionid

    GET /api/v1/meeting

    GET /api/v1/meeting/cancel/{event_id}

    GET /api/v1/pricelist

    GET /api/v1/subscrption

    GET /api/v1/user

    POST /api/v1/agreement

    POST /api/v1/contact

    POST /api/v1/contactform

    POST /api/v1/document

    POST /api/v1/meeting

    POST /api/v1/reset

    POST /api/v1/subscribe

    POST /api/v1/upgradeToBankIdVerificationMail

    POST /api/v1/authenticateBankIdUpgrade

    PUT /api/v1/reset

    PUT /api/v1/user

    DELETE /api/v1/document

    OAuth

    Managing API access is done through an end customers user account, and each user account may have zero or more client credentials.

    These client credentials may be used to request privileges from users. Users, in turn, can approve or deny granting such privileges.

    The OAuth authorisation sequence allows you to request privileges from a user and retrieve token credentials. Once these have been approved, you may use the token credentials to make API requests on behalf of the user.

    OAuth privileges

    OAuth Workflow using cURL

    Here we provide some examples using the cURL command.

    2. Authorisation redirect:

    http(s)://${host}/api/v1/oauth/authorize?response_type=code&client_id=testclient&state=abc

    If the user grants access to your application, they will be redirected to:

    http://www.mywebsite.com/login?code=cd52984f895b1710f962b89631a1c3b8cc411ba5&state=abc
        

    3. You should now request for an OAuth token using all the information:

    $ curl -u testuser:testpwd 'https://${host}/api/v1/oauth/token' \
          -d 'grant_type=authorization_code&code=cd52984f895b1710f962b89631a1c3b8cc411ba5'
        

    You should now be able to perform an API call with the access_token or jwt you recived above, for example:

    $ curl 'https://${host}/api/v1/user' \
          -H 'Authorization: Bearer 929a7c3cffbb0c03a87dec5153efb310a983f360'
        

    Permission required for each API call are described on a per call basis.

    1. Authorisation redirect
    2. Token request and response

    Before you can start sending requests for client credentials we will need to setup username and password for you. Please contact us on it@lexly.com to get this. When you request this you need to provide us with the oauth_callback URL.

    1. Authorisation redirect

    You authorize your client via an authorization page. Either our web login page or your own form. If you are using our form it will have a URL like this http(s)://${host}/api/v1/oauth/authorize?response_type=code&client_id=${client_id}&state=${oauth_state} where ${client_id} is the same as the username you've got from us and ${oauth_state} can be anything, example 'abc'.

    The user will be asked to grant you the requested privileges by login with their existing account.

    If they accept and login they will be redirected to:

    • ${oauth_callback}?code=${oauth_code}&state=${oauth_state}

    If they reject, the redirection will be to:

    • ${oauth_callback}?error=access_denied&error_description=The+user+denied+access+to+your+application&state=${oauth_state}

    Therefore, you should be able to inspect the redirection to the callback URL.

    2. Token request

    Now you should have the following pieces of information:

    • oauth_code

    We then request the access_token, jwt and refresh_token by sending the oauth_code by cURL:

    • curl -u ${client_username}:${client_password} http(s)://${host}/api/v1/oauth/token -d 'grant_type=authorization_code&code=${oauth_code}'

    This will generate something like the following:

    • { "access_token": "446fa40e9bc80197410b7f24fb72e75bd33d4351", "expires_in": 3600, "token_type": "Bearer", "scope": "Private", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJp4MTkwMTUzMCwia.....YILTZIY6kH_PvLTYCIXb6GOihmmdvd0SrAq15wOFy7x9Zt9itsjRVU", "refresh_token": "551d806eee00ceb0be27615652ebbb046ffd7e51" }

    When a token has expired you can request for a new one by sending the "refresh_token" as follow:

    • curl 'https://${host}/api/v1/oauth/token' -u '${client_username}:${client_password}' -d 'grant_type=refresh_token&refresh_token=${refresh_token}'

    Responses

    Code Description
    200

    Login ok and a token is returned.

    400

    Authorization code doesn't exist or is invalid for the client (invalid_grant).

    400

    The grant type was not specified in the request (invalid_request).

    400

    Missing parameter: "code" is required (invalid_request).

    With this access token you can now access client data for the user who granted it by sending cURL requests as following:

    • curl http(s)://${host}/api/v1/user -H 'Authorization: Bearer [ ${access_token} or ${jwt} ]'

    The following APIs can be accessed this way:

    GET /api/v1/account/{id}

    GET /api/v1/agreement/{agreement_id}

    GET /api/v1/contactform

    GET /api/v1/document/{file_id}

    GET /api/v1/getsessionid

    GET /api/v1/meeting

    GET /api/v1/meeting/cancel/{event_id}

    GET /api/v1/pricelist

    GET /api/v1/subscrption

    GET /api/v1/user

    POST /api/v1/agreement

    POST /api/v1/contact

    POST /api/v1/contactform

    POST /api/v1/meeting

    POST /api/v1/document

    POST /api/v1/reset

    POST /api/v1/subscribe

    PUT /api/v1/reset

    PUT /api/v1/user

    DELETE /api/v1/document

    CID

    Auth Workflow using cURL

    Here we provide some examples using the cURL command.

    1. Authorization for via cURL:

    $ curl 'https://${host}/api/v1/${api}' \
          -H 'Auth: cid={CID} -H 'TimeZone: {TimeZone}

    Instead of OAuth, the end user can access a same data by CID authentication. The CID will automatic be generated when a calendar entry for a specific client is created.

    You will get the CID from the current customer. When you've got it you can access the APIs by sending it in the header regardless if you are using POST or GET. It should be written in the following format:

    Auth: cid=${CID}

    The following APIs can be accessed in this way:

    GET /api/v1/agreement/{agreement_id}

    GET /api/v1/meeting

    GET /api/v1/meeting/cancel/{event_id}

    POST /api/v1/agreement

    GET /api/v1/pricelist

    GET /api/v1/subscrption

    POST /api/v1/meeting

    POST /api/v1/document

    POST /api/v1/reset

    POST /api/v1/subscribe

    PUT /api/v1/reset

    Transaction

    Register

    Example of posted data:

    {
      "userData": {
        "email": "test-003@lexly.com",
        "phone": "12345678",
        "language": "finnish",
        "timezone": "Europe/Helsinki"
      },
      "providerData": {
        "fiTupas":{
          "uiLocale": "sv-FI",
          "redirectUrl": "https://lexly.fi"
        }
      },
      "authProvider":  "fiTupas"
    }
                

    Example of returned data if all went well:

    {
      "accessUrl": "https:// ...",
      "id": "580c7da5-375b-47f1-ac9f-34990edcf103"
    }

    POST /api/v1/oauth/transaction/register

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    userData->email
    required

    string
    application/json

    Json

    userData->phone
    required

    string
    application/json

    Json

    userData->language
    required

    string
    application/json

    Json

    userData->timezone
    required

    string
    application/json

    Json

    providerData->fiTupas->uiLocale
    required

    string
    application/json

    Json

    providerData->fiTupas->redirectUrl
    required

    string
    application/json

    Json

    authProvider
    required

    boolean
    application/json

    Json

    Responses

    Code Description
    200

    Returning the transaction id and access url if everything went well

    400

    Missing or invalid parameters

    403

    Authentication failed (request_parameters_missing)

    500

    Could not connect to authentication provider

    Auth

    Example of posted data:

    {
      "providerData": {
        "fiTupas":{
          "uiLocale": "sv-FI",
          "redirectUrl": "https://lexly.fi"
        }
      },
      "authProvider":  "fiTupas"
    }
                

    Example of returned data if all went well:

    {
      "accessUrl": "https:// ...",
      "id": "580c7da5-375b-47f1-ac9f-34990edcf103"
    }

    POST /api/v1/oauth/transaction/auth

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    providerData->fiTupas->uiLocale
    required

    string
    application/json

    Json

    providerData->fiTupas->redirectUrl
    required

    string
    application/json

    Json

    authProvider
    required

    boolean
    application/json

    Json

    Responses

    Code Description
    200

    Returning the transaction id and access url if everything went well

    400

    Missing or invalid parameters

    403

    Authentication failed (request_parameters_missing)

    500

    Could not connect to authentication provider

    Get Transaction

    Example of returned data if all went well:

    {
    	"status": "new" | "started" | "complete" | "failed",
    	"authData": {
    		"access_token": <access_token>,
    		"expires_in": <expires_in>,
    		"token_type": <token_type>,
    		"scope": <scope>,
    		"jwt": <jwt>,
    		"refresh_token": <refresh_token>
    	},
    	"errorData": {
            "error": "access_denied",
            "errorCode": "cancel",
            "errorDescription": "..."
        }
    
    }

    GET /api/v1/oauth/transaction/{id}

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    id
    required

    string

    Path

    Responses

    Code Description
    200

    Returning the status of the transaction

    400

    Missing or invalid parameters

    400

    User doesn't have ssn

    403

    Authentication failed (request_parameters_missing)

    404

    The transaction doesn't exist or has expired

    409

    Transaction was started with "register" but user already exists

    500

    Could not connect to authentication provider

    Enable single sign-on

    To enable single sign-on from an external site to make it possible to create new agreements or going into the business portal you need to setup a session cookie with the following name and format for the current domain:

    PHPSESSID=p8ln19nh69udh8pp3s45k6rde3; domain=.lexly.com

    The value for the PHPSESSID should be the same as the one you get in your API request. You can get the current session id with the API function Get session id

    Errors

    Error responses will contain a JSON response body, structured as follows:

    {
          "error_type": "${error_type}", 
          "error_message": "${error_type}", 
          "http_code": ${http_code}
        }
        

    For example:

    {
          "error_type": "invalid_client", 
          "error_message": "The client id supplied is invalid", 
          "http_code": 400
        }
        

    Lexly uses HTTP status codes to indicate the success or failure of an API request.

    HTTP response codes in the 2xx range indicate that the API call completed successfully. The 4xx range indicates an error, either due to missing, incomplete, or not applicable information (e.g. missing or invalid parameters, invalid authorisation, etc.).

    When a request is well formed, but does not satisfy necessary conditions, then we will return a 409 code. For example, when trying to book a meeting that's already booked.

    Codes in the 5xx range suggest an error with Lexlys booking system, they could also indicate planned system downtime, and will be rare.

    The following table of error responses applies to all API calls, there may be additional errors which are specific to the respective API calls, but will follow the same structure.

    HTTP code Reason Error Type and Message
    400 Bad Request Required parameter(s) missing

    request_parameters_missing

    The parameter(s) $bad_parameters$ were missing. Please refer to our API documentation.

    400 Bad Request Login failure (Oauth specific) - different error messages

    invalid_grant_type

    The grant_type is invalid


    invalid_client

    "Client credentials were not found in the headers or body", "Supplied response_type isn't supported", "No client id supplied", "The client id supplied is invalid"

    400 Bad Request Login failure (Calendar specific) - different error messages

    missing_calendar_information

    Missing needed calendar information.


    no_deal_id

    Missing needed deal id.


    missing_advisor_info

    Missing needed advisor information.

    400 Bad Request Failed to upload a file (upload specific)

    failed_to_upload_file

    This file type is not supported.


    failed_to_upload_file

    Failed to upload file.

    401 Unauthorised No or invalid access credentials

    invalid_authorisation

    No valid access credentials were provided. Please refer to our API documentation.


    invalid_grant

    Authorization code doesn't exist or is invalid for the client

    401 Unauthorised No or invalid access credentials (oauth specific)

    invalid_authorisation

    No valid access credentials were provided. Please refer to our API documentation.


    invalid_grant

    Authorization code doesn't exist or is invalid for the client


    invalid_password

    The user exist but the password is invalid.


    missing_bankid

    The user exist, please login with bankid.


    missing_password

    The user exist, please login with password.

    invalid_grant

    Some error with the auth credentials or the credentials may not have sufficient privileges.

    401 Unauthorised No or invalid access credentials (account specific)

    invalid_authorisation

    You don't have access for the requested id.

    403 Forbidden User doesn’t have permission for a document action or retrieval

    insufficient_privileges

    The access credentials provided do not have sufficient privileges for this request.

    403 Forbidden User doesn’t have permission for a document action or retrieval (oauth specific)

    invalid_grant

    Auth credentials are invalid or they may not have sufficient privileges.

    404 Not Found The endpoint exists but the resource was not found.

    resource_not_found

    The resource was not found.

    We will try to give additional information about what is missing.

    409 Conflict New new user is registered but the .

    user_already_exist

    The user already exist.

    500 Server Error Other unexpected server error

    server_error

    We encountered an unexpected error. Please contact Lexly support and include as much details about what caused the error.

    List of API Calls

    Get

    GET /api/v1/account/{id}

    GET /api/v1/agreement/{agreement_id}

    GET /api/v1/contactform/{partner_id}

    GET /api/v1/company/{organisation_number}

    GET /api/v1/deals

    GET /api/v1/document/{file_id}

    GET /api/v1/getcompanyinfo/{organisation_number}

    GET /api/v1/getsessionid

    GET /api/v1/image

    GET /api/v2/image

    GET /api/v1/logout

    GET /api/v1/meeting

    GET /api/v1/meeting/{date}/{dealid}

    GET /api/v1/meeting/cancel/{event_id}

    GET /api/v1/partnerform

    GET /api/v1/subscrption

    GET /api/v1/user

    GET /api/v1/pricelist

    Post

    POST /api/v1/agreement

    POST /api/v1/contact

    POST /api/v1/contactform

    POST /api/v1/company

    POST /api/v1/document

    POST /api/v1/meeting

    POST /api/v1/partnerform

    POST /api/v1/reset

    POST /api/v1/subscribe

    POST /api/v1/user

    POST /api/v1/upgradeToBankIdVerificationMail

    POST /api/v1/authenticateBankIdUpgrade

    Put

    PUT /api/v1/reset

    PUT /api/v1/user

    Delete

    DELETE /api/v1/agreement/{agreement_id}

    DELETE /api/v1/document/{file_id}

    DELETE /api/v1/subscribe

    Get

    Cancel a meeting

    Example of returned data:

    {
      "status": true
    }
    

    GET /api/v1/meeting/cancel

    GET /api/v1/meeting/cancel/{event_id}

    Cancelling a booked meeting. The event_id of the current meeting has to be included if the authorization is made with Oauth but not if CID authorization is used. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials, OAuth and CID

    See Authentication

    Parameters

    Parameter Description Type In

    event_id
    (sometime required)

    The event_id is the id of the event that should be cancelled. This is required on Oauth Credentials but shouldn't be included on CID authorisation.

    integer
    int64

    path

    Responses

    Code Description
    200

    Returning status true if cancellation was successful.

    400

    Required fields missing or incorrect.

    Get agreement

    Example of returned data:

    {
      "pages": [
        {
          "page": 1,
          "page_title": "Test Form",
          "steps": [
            {
              "step": 1,
              "step_title": "Basic information",
              "content": [
                {
                  "info": "This is the step for basic information."
                },
                {
                  "question": "You name?",
                  "variable": "field1",
                  "type": "text",
                  "max_length": 90
                },
                {
                  "question": "Where do you live?",
                  "variable": "field2",
                  "type": "select",
                  "values": [
                    "Sweden",
                    "Norway",
                    "Denmark"
                  ],
                  "step_rules": [
                    {
                      "option": "Norway",
                      "page": 8,
                      "step": 1,
                    },
                    {
                      "option": "Sweden",
                      "page": 7,
                      "step": 1,
                    }
                  ]
                }
              ]
            },
          {
            ... (next step)
          }
        ]
        },
        {
          "page": 2,
          "page_title": "More questions...",
          "steps": [...]
        },
        {
          ... (next page)
        }
      ]
    }

    GET /api/v1/agreement/{agreement_id} GET /api/v1/agreement/{agreement_id}/?<partner_id={partner_id}>&<deal_id={deal_id}>

    Get the structure of an agreements flow to be able to implement the correct agreement flow in you own from. To get the data you need a correct agreement_id in the URL. The data is returned in JSON format.

    If partner_id or deal_id is included in the request you will get back the a customised partner agreement flow.

    The basic structure is constructed with pages and steps as follow:

    { "pages": [ { "page": 1, "page_title": "Page 1", "steps": [ { "step": 1, "step_title": "Section 1", "content": [ ] }, { ... (next section) } ] }, { "page": 2, "page_title": "Page 2", "steps": [] }, { ... (next page) } ] }

    Each step can then contain the following sections:

    Inforamtion text

    { "info": "Comment HTML text..." " },

    Stand alone rules

    Could for example be used after a information text section. After the "if" section you define where you should go if the case is true. The destination works in the same way as "step_rules" below. The destination can be just "page" or "page" and "step". If the flow should be finished you just setting "page" to "finish".

    { "if": [ { "field": "field9", "value": "no" } ], "page": "finish" },

    An input field in different formats

    If there is a limit on how long/big the value can be written, then "max_length"/"max_value" must be specified. Max_length is just valid in fields of the type "text".

    { "question": "The question...", "variable": "field_129", "type": "text|number|textblock", "max_length": 70, <--- Just for "text" "max_value": 10 <--- Just for "number" "obligatory": true <--- If it has to be filled in },

    A checkbox

    A checkbox can have a value. If not it should just return the value true if it's checked.

    { "question": "The question...", "variable": "field_129", "type": "checkbox", "value": "a value", "obligatory": true <--- If it has to be checked },

    Predefined alternative choices (radio or select)

    Under "values" is it defined which different choices to choose from.

    If the value that should be sent isn't the same as the visible option, the visible values can be defined under "options".

    Under "step_rules" it is defined whether a specific choice should mean jumping to another page / section. If nothing is specified for selection then the next option in the flow will be the one closest to the current one. The step rules can also regards to an earlier value. In this case you define "pre_options" and defining witch value an earlier variable should have to fullfill the step_rule.

    { "question": "The question...", "variable": "field_130", "type": "select|radio", "obligatory": true <--- If get a value "options": [ "Yes", "No", "I don't know" ], "values": [ "data5", "data6", "data7" ], "step_rules": [ { "option": "data5", "page": 5, "step": 2 }, { "pre_options": [ { "pre_variable": "field24", "pre_value": "data1" } ], "option": "data6", "page": 8, "step": 1 } ] },

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The current deals the partner has. The data is returned in JSON format.

    400

    The requested agreement_id do not have any public structure in JSON format.

    Get company

    Example of returned data:

    {
      "org_number": "5562408475",
      "org_name": "Siteam Aktiebolag",
      "address": "TIDELIUSGATAN 23",
      "zip": "11869",
      "city": "STOCKHOLM",
      "county": "STOCKHOLM"
    }

    GET /api/v1/company/{organisation_number}

    Get registered company information from the current site if it's registered. If the requested organisation number isn't registered as a customer it will just return status set to false. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The company information for the requested organisation number if it's a customer. The data is returned in JSON format.

    400

    Required organisation number don't belong to a customer or is incorrect.

    Get company info

    Example of returned data:

    {
      "return": {
        "postTyp": "B01",
        "status": "00",
        "peorgnrId": "165562408475",
        "firma": "Siteam Aktiebolag",
        "gatuadress": "TIDELIUSGATAN 23",
        ...
        "regdatum": "19840411",
        "lanKomKod": "0180",
        "sektortext": "Icke-finansiella bolag utom affärsverk",
        "isOld": true,
        "lopnr": "00000",
        "firmaTotal": "Siteam Aktiebolag",
      }
    }

    GET /api/v1/getcompanyinfo/{organisation_number}

    Get registered company information. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The company information for the requested organisation number. The data is returned in JSON format.

    400

    Required organisation number missing or incorrect.

    Get contact form structure

    Example of returned data:

    {
      "legal_areas": [
        {
           "name": "Familjejuridik",
           "form_type": "flexible_form",
           "category": "private",
           "selected": "false",
        },
        ...
      ],
      "flexible_form": {
        "contact_form": {
          "form_type": "contact_form",
        },
        ...
      },
      "contact_form": {
        "contact_when": [
          "morning",
          "afternoon",
          "evening"
        ],
        ...
      },
      ...
    }

    GET /api/v1/contactform/

    GET /api/v1/contactform/{partner_id}?<product_id={product_id}> or <product_number={product_number}>

    Get the structure for a contact form - general, for a specific partner and/or for a specific product.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    partner_id

    The partner_id is used to get partner specific contact form setup.

    number

    path

    product_id

    A product_id is used to get related legal_area hi-lighted as selected. The product_id is the same as id in the pricelist.

    number

    path

    product_number

    A product_number is used to get related legal_area hi-lighted as selected.

    number

    path

    Responses

    Code Description
    200

    The data is returned in JSON format and describes potential forms and which values that should be posted to contactform.

    Get deals

    Example of returned data:

    {
      "deals": [
        {
          "deal_id": "92",
          "deal_name": "Nadia",
          "customer_type": "private"
        },
        {
          "deal_id": "93",
          "deal_name": "Eva",
          "customer_type": "private"
        },
        {
          "deal_id": "100",
          "deal_name": "avtal24",
          "customer_type": "private"
        }
      ]
    }

    GET /api/v1/deals

    Get the the deals (customer segments) you as a partner have. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The current deals the partner has. The data is returned in JSON format.

    400

    Required fields missing or incorrect.

    Get document

    GET /api/v1/document/{file_id}

    GET /api/v1/document/{file_id}/{key}

    Get the file that is associated with the customer information for the Oauth identified user. If

    Header

    Header Description Example

    Authentication
    sometime required

    Supports Partner OAuth Credentials, OAuth and CID. Not needed if a key is included in the URL.

    See Authentication

    Parameters

    Parameter Description Type In

    file_id
    required

    The file_id you get when requesting user information.

    string
    application/json

    path

    key

    A generated key that's generated when a new a agreement is created. The key will just work for a short period.

    string
    application/json

    path

    Responses

    Code Description
    200

    The requested file is returned in the current file format.

    400

    Required fields missing or incorrect (request_parameters_missing).

    401

    No valid access credentials were provided (invalid_authorisation).

    404

    The resource was not found (resource_not_found).

    Get image v1

    Example of a returned image:

    Code: <img src="https://api.lexly.se/api/v1/image/housing-situation/tomorrow?situation=bought-before&gender=man&gender-partner=woman">

    Code: <img src="https://api.lexly.se/api/v1/image/inheritance-analysis/i-die?situation=married&gender=man&gender-partner=woman&children=1,6&orphan-children=5">

    Code: <img src="https://api.lexly.se/api/v1/image/life-insurance/with/partner-die?gender=man&gender-partner=woman&children=1,6&orphan-children=5">

    GET https://api.lexly.se/api/v1/image/housing-situation/{today|tomorrow}?<situation={married|partner|bought-before}>&<gender={man|woman}>&<gender-partner={man|woman}>

    GET https://api.lexly.se/api/v1/image/inheritance-analysis/{today|i-die|partner-die}?<situation={single|married|partner}>&<gender={man|woman}>&<gender-partner={man|woman}>&<children={age,age,...}>&<orphan-children={age,age,...}>&<bonus-children={age,age,...}>

    GET https://api.lexly.se/api/v1/image/life-insurance/{with|without}/{i-die|partner-die}?<gender={man|woman}>&<gender-partner={man|woman}>&<children={age,age,...}>&<orphan-children={age,age,...}>&<bonus-children={age,age,...}>

    With this API, SVG images can be generated based on specified parameters in different situations in life. The tool has support for creating images for life situations housing situation, inheritance analysis and life insurance.

    Header

    Header Description Example

    Nothing required.

    Parameters

    When generating an image for housing situation. Potential URL /api/v1/image/housing-situation/today and /api/v1/image/housing-situation/tomorrow. All parameters below should be send in the QUERY_STRING.
    Please note: If it's a partner relation and the house was bought before the partners moved together, set the situation to "bought-before".

    Dimention: 4:3

    Parameter Description Type In

    situation

    The current life situation. If it is a single person, this parameter is not needed.

    string
    Potential values: married, partner, bought-before

    path

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman

    path

    When generating an image for life insurance. Potential URL /api/v1/image/inheritance-analysis/today, /api/v1/image/inheritance-analysis/i-die and /api/v1/image/inheritance-analysis/partner-die. All parameters below should be send in the QUERY_STRING.

    Dimention: 1:1

    Parameter Description Type In

    situation

    The current life situation. If it is a single person, this parameter is not needed.

    string
    Potential values: single, married, partner

    path

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman

    path

    children

    A list of the ages of the common children.

    numbers, separated with ,
    Example: 4,8,12

    path

    orphan-children

    A list of the ages of the orphaned children.

    numbers, separated with ,
    Example: 4,8,12

    path

    bonus-children

    A list of the ages of the bonus children.

    numbers, separated with ,
    Example: 4,8,12

    path

    When generating an image for inheritance analysis. Potential URL /api/v1/image/life-insurance/without/i-die, /api/v1/image/inheritance-analysis/without/partner-die, /api/v1/image/life-insurance/with/i-die and /api/v1/image/inheritance-analysis/with/partner-die. All parameters below should be send in the QUERY_STRING.

    Dimention: 3:2

    Parameter Description Type In

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman

    path

    children

    A list of the ages of the common children.

    numbers, separated with ,
    Example: 4,8,12

    path

    orphan-children

    A list of the ages of the orphaned children.

    numbers, separated with ,
    Example: 4,8,12

    path

    bonus-children

    A list of the ages of the bonus children.

    numbers, separated with ,
    Example: 4,8,12

    path

    Responses

    An image is always returned from this API. If the parameters are not set correctly, the answer will be just an empty house image.

    Get image v2

    Example of a returned image:

    Code: <img src="https://api.lexly.se/api/v2/image/housing-situation/tomorrow?situation=bought-before&gender=man&gender-partner=woman">

    Code: <img src="https://api.lexly.se/api/v2/image/housing-situation/alone?gender=woman">

    GET https://api.lexly.se/api/v2/image/housing-situation/{alone|today|tomorrow}?<situation={married|partner|bought-before}>&<gender={man|woman|neutral}>&<gender-partner={man|woman|neutral}>

    GET https://api.lexly.se/api/v2/image/inheritance-analysis/{today|i-die|partner-die}?<situation={single|married|partner}>&<gender={man|woman|neutral}>&<gender-partner={man|woman|neutral}>&<children={age,age,...}>&<orphan-children={age,age,...}>&<bonus-children={age,age,...}>

    GET https://api.lexly.se/api/v2/image/life-insurance/{with|without}/{i-die|partner-die}?<gender={man|woman|neutral}>&<gender-partner={man|woman|neutral}>&<children={age,age,...}>&<orphan-children={age,age,...}>&<bonus-children={age,age,...}>

    GET https://api.lexly.se/api/v2/image/coins/{two|four|down}

    GET https://api.lexly.se/api/v2/image/carries-house/{woman|man|neutral}

    With this API, SVG images can be generated based on specified parameters in different situations in life. The tool has support for creating images for life situations housing situation, inheritance analysis and life insurance.

    Header

    Header Description Example

    Nothing required.

    Parameters

    When generating an image for housing situation. Potential URL /api/v2/image/housing-situation/today and /api/v2/image/housing-situation/tomorrow. All parameters below should be send in the QUERY_STRING.
    Please note: If it's a partner relation and the house was bought before the partners moved together, set the situation to "bought-before".
    For generating an image with just one person and a house use /api/v2/image/housing-situation/alone?gender={man|woman|neutral}

    Dimention: 82:37

    Parameter Description Type In

    situation

    The current life situation. If it is a single person, this parameter is not needed.

    string
    Potential values: married, partner, bought-before, alone

    path

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman, neutral

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman, neutral

    path

    Code: <img src="https://api.lexly.se/api/v2/image/inheritance-analysis/i-die?situation=married&gender=man&gender-partner=woman&children=1,6&orphan-children=5">

    When generating an image for inheritance analysis. Potential URL /api/v2/image/inheritance-analysis/today, /api/v2/image/inheritance-analysis/i-die and /api/v2/image/inheritance-analysis/partner-die. All parameters below should be send in the QUERY_STRING.

    Dimention: 55:43

    Parameter Description Type In

    situation

    The current life situation. If it is a single person, this parameter is not needed.

    string
    Potential values: single, married, partner

    path

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman, neutral

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman, neutral

    path

    children

    A list of the ages of the common children.

    numbers, separated with ,
    Example: 4,8,12

    path

    orphan-children

    A list of the ages of the orphaned children.

    numbers, separated with ,
    Example: 4,8,12

    path

    bonus-children

    A list of the ages of the bonus children.

    numbers, separated with ,
    Example: 4,8,12

    path

    Code: <img src="https://api.lexly.se/api/v2/image/life-insurance/with/partner-die?gender=man&gender-partner=woman&children=1,6&orphan-children=5">

    When generating an image for life insurance. Potential URL /api/v2/image/life-insurance/without/i-die, /api/v2/image/inheritance-analysis/without/partner-die, /api/v2/image/life-insurance/with/i-die and /api/v2/image/inheritance-analysis/with/partner-die. All parameters below should be send in the QUERY_STRING.

    Dimention: 3:2

    Parameter Description Type In

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman, neutral

    path

    gender-partner

    The gender of the primary persons partner in the picture. If it is a single person, this parameter is not needed.

    string
    Potential values: man, woman, neutral

    path

    children

    A list of the ages of the common children.

    numbers, separated with ,
    Example: 4,8,12

    path

    orphan-children

    A list of the ages of the orphaned children.

    numbers, separated with ,
    Example: 4,8,12

    path

    bonus-children

    A list of the ages of the bonus children.

    numbers, separated with ,
    Example: 4,8,12

    path

    Code: <img src="https://api.lexly.se/api/v2/image/coins/two">
    <img src="https://api.lexly.se/api/v2/image/coins/four">
    <img src="https://api.lexly.se/api/v2/image/coins/down">

    For generating images of coins there are three different potential images: /api/v2/image/coins/two, /api/v2/image/coins/four and /api/v2/image//coins/down.

    Dimention: 198:129 - /api/v2/image/coins/two
    Dimention: 166:198 - /api/v2/image/coins/four
    Dimention: 280:218 - /api/v2/image/coins/down

    Parameter Description Type In

    Doesn't take any parameters.

    1/6 1/6 1/6 1/2
    Example of usage.

    Code: <img src="https://api.lexly.se/api/v2/image/carries-house?gender=woman">

    For generating images of a human wearing a house the input should be in the following format: /api/v2/image/carries-house?gender={woman|man|neutral}

    Dimention: 2:3

    Parameter Description Type In

    gender
    required

    The gender of the primary person in the picture.

    string
    Potential values: man, woman, neutral

    path

    Responses

    An image is always returned from this API. If the parameters are not set correctly, the answer will be just an empty house image.

    Get free meeting slots

    Example of returned data (day):

    {
      "date": "2019-03-20",
      "open_time": "8-20",
      "slot_length": 30,
      "partner": "testab",
      "deal_id": "100",
      "slots": [
        {
          "starttime": "0800",
          "length": "30",
          "lawyer": "116767"
        },
        {
          "starttime": "0830",
          "length": "30",
          "lawyer": "97940"
        }
      ]
    }

    Example of returned data (month):

    {
      "category": "business",
      "freeslots": [
        "2021-12-01",
        "2021-12-06",
        "2021-12-17",
        "2021-12-30"
      ]
    }

    GET /api/v1/meeting/{date or month}/{dealid}?<partner={partner_shortname}>&&&<product={product_id}>&<category={private|business}>&<type={1 or 2}> (Partner Access Credentials)

    GET /api/v1/meeting/{date or month}/{dealid}?<partner={partner_shortname}>&&&<product={product_id}>&<category={private|business}>&<type={1 or 2}> (Partner Access Credentials)

    GET /api/v1/meeting/{date or month}?<product={product_id}>&<category={private|business}>&<type={1 or 2}> (Oauth or CID)

    GET /api/v1/meeting/{date or month}?<product={product_id}>&&<category={private|business}>&<type={1 or 2}> (Oauth or CID)

    This API can be used for receiving two different kind of data. If just a month (YYYY-MM) is sent sent in the URL all dates in the month with free slots will be returned. If a specific date is sent all free meeting slots for a given date will be returned. This function can be requested either by CID, Partner Access Credentials or Oauth. Required parameters depends on if it's accessed with CID, Partner Access Credentials or Oauth. The output is in JSON format.

    In the swedish version you can send product category instead of product_id. The available categories are "business" and "private".

    Header

    Header Description Example

    Authentication
    required

    Supports all kind of authentication

    See Authentication

    TimeZone
    optional

    Used for setting the the time zone for incoming and outgoing date and time stamps. As default it's set to GMT (except for avtal24.se that's set to Europe/Stockholm).

    TimeZone: Europe/Paris

    Parameters

    Parameter Description Type In

    date or month
    required

    Use date to receive free slots for the given date OR use month to get all dates in the given month with free slots.

    date
    YYYY-MM-DD (date)
    YYYY-MM (month)

    path

    partner

    The partner short name (customer segment) (ex "mybank") the customer is connected to. This shouldn't be included on CID or OAuth authorisation.

    string

    query_string

    partnerid

    The partner_id (customer segment) the customer is connected to. This shouldn't be included on CID or OAuth authorisation.

    integer
    int64

    query_string

    dealid
    (sometime required)

    The deal_id (customer segment) the customer is connected to. This is required on Partner Access Credentials but shouldn't be included on CID or OAuth authorisation.

    integer
    int64

    path (after date see above) or query_string

    product
    (sometime required)

    Can be given to get correct length (type) and free slots for a lawyer who's working with the given product. Example of product (id) is 10232.

    integer
    int64

    query_string

    category
    (sometime required)

    Can be used for get free slots for a lawyer who's working with private or business agreements (just used in Sweden). The default value if nothing is given is 'private'. Possible values: 'private', 'business'

    string

    query_string

    type
    (sometime required)

    You can get free slots for 30 or 60 min. The default value '2' gives free 30 min slots and '1' gives free 60 min slots.

    integer
    int64

    query_string

    Responses

    Code Description
    200

    The free meeting slots available to book for the customer. The data is returned in JSON format.

    400

    Required fields missing or incorrect.

    Get booked meeting information

    Example of returned data:

    {
      "events": [
        {
          "event_id": "57573",
          "canceled": false,
          "title": "Test meeting",
          "start_at": "2019-05-02 08:00:00",
          "end_at": "2019-05-02 08:30:00",
          "customer_email": "test.testsson@lexly.se",
          "customer_name": "Test Testson",
          "customer_phone": "9348732423",
          "lawyer_email": "test.lawyer@lexly.com",
          "lawyer_name": "Test Lawyer"
        }
      ]
    }

    GET /api/v1/meeting

    Get all booked meetings for the identified user. This function can be requested either by CID or Oauth. The output is in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials, OAuth and CID

    See Authentication

    TimeZone
    optional

    Used for setting the the time zone for incoming and outgoing date and time stamps. As default it's set to GMT (except for avtal24.se that's set to Europe/Stockholm).

    TimeZone: Europe/Paris

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The authorization code is ok. The data is returned in JSON format.

    400

    Authorization code doesn't exist or is invalid for the client.

    Get partner form structure

    Example of returned data:

    {
      "customer_segments": [
        {
           "name": "Privatkund",
           "deal_id": 32,
        },
        ...
      ],
      "legal_areas": [
        {
           "name": "Familjejuridik",
           "value": "family-law",
           "form_type": "flexible_form",
           "category": "private",
        },
        ...
      ],
      "form_types": [
        "flexible_form": {
          "contact_form": {
            "meeting_type": "Mail",
            "form_type": [
              "contact_form"
            ]
          },
          ...
        },
        "contact_form": {
          "preferred_meeting_type": [
            {
              "name": "Telefon",
              "value": "phone",
            },
            ...
          ],
          "return_fields": {
            "deal_id": required,
            "legal_area": "required",
            "preferred_meeting_type": "required",
            "customer": {
              "ssn": "required",
              "name": "required",
              "email": "required",
              "phone": "required"
            },
            "advisor": {
              "email": "required",
              "group": "required",
              "subgroup": "optional"
            }
          }
        },
        ...
      ],
    }

    GET /api/v1/partnerform/

    Get the structure for a partner form for the partner that's specified in the authorization header. It will return info about the customer_segments, the current legal_areas and the fields that should be returned for the different legal areas for the current partner. The form type "flexible_form" lists which different form setups that should be returned for the different potential selections.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Accept-Language

    Specify the language in which the content should be returned. Possible languages are indicated as the following - only one should be specified: sv, en, etc

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The data is returned in JSON format and describes potential forms and which values that should be posted to contactform.

    Get pricelist

    Example of returned data:

    {
      "business_agreements": [
        {
          "id": "9761",
          "product_name": "Aktieägaravtal",
          "product_description": "Kompanjonsavtal mellan ägarna i ett aktiebolag",
          "vat": 25,
          "slug": "aktieagaravtal",
          "translation_price": 2800,
          "online": {
            "product_number": 2071,
            "price": 2995,
            "temp_price": 2750
          },
          "lawyer": {
            "product_number": 2571,
            "price": 9999,
            "temp_price": 9500
          }
        },
        ...
      ]
    }

    GET /api/v1/pricelist

    GET /api/v1/pricelist/{deal_id}

    Get the pricelist for the current deal_id. If deal_id isn't included in the request the general pricelist will be returned. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    (occasionally required)

    Is required when a deal_id is included in the URL. Supports Partner OAuth Credentials, CID and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    Information about the current user and bought agreements. The data is returned in JSON format.

    Response data

    The data will be returned organized in four different categories - "business_agreements", "offers", "private_agreements", "addons".

    Variable Description Type In
    id The ID of the product Integer
    product_name The name of the product String
    brief_description A short description of the product String
    product_description A description of the product String
    vat The current VAT for the product i percent Float
    category Can have one or more value(s) of 'private' and 'business' String
    slug The part of a URL which identifies the particular product String a-z
    translation_price The price for translating the product Float
    online > product_number The products "product number" Integer
    online > price Standard price for the product online Float
    online > temp_price A temporary price for the product online Float
    online > partner_price The products price via the current partner Float
    online > partner_discount The partner discount for the current partner in percent Float
    lawyer > product_number The products "product number" Integer
    lawyer > price Standard price for the product via a lawyer Float
    lawyer > temp_price A temporary price for the product via a lawyer Float
    lawyer > partner_price The products price via the current partner Float
    lawyer > partner_discount The partner discount for the current partner in percent Float

    Get session id

    Example of returned data:

    {
      "sessionid": "n21birvlfqtkurascv2p7qcdm6"
    }

    GET /api/v1/getsessionid

    Get the current session ID on the backend server. This can be usable if a web solution partly will work via API and partly via javascript against the backend server. The data is returned in JSON format.

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    The current session ID is returned. The data is returned in JSON format.

    GET /api/v1/getcompanyinfo/{organisation_number}

    Get subscrptions for business services

    GET /api/v1/subscrption

    Get different subscriptions for (cloud portal) business services.

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    Information about the current subscription for business services (in Sweden Lexly Business). The data is returned in JSON format.

    Response data

    The data will be returned in an array of objects with subscription information ordered by product_id.

    Variable Description Type In
    id The unique id for the current subscription String
    subscription_type The name of the subscription type String
    product_id The current is for the product String
    price_excl_vat Price excl VAT String
    free_agreements The number of free agreements that's included in the package. String
    free_e_signs The number of free e-signes that's included in the package. String
    free_behov The number of free agreements that's included in the package. String
    free_30min The number of free agreements that's included in the package. String

    Get user

    Example of returned data:

    [
      "customer": {
        "id": "354871",
        "name": "Lars Olsson",
        "email": "lars.olsson@email.com",
        "phone": "0704520825",
        "ssn": "193703070289",
        "address": "Testvägen 3",
        "address2": "",
        "zip": "11122",
        "city": "Stockholm",
        "deal_id": "170"
      },
      "bought": [
        {
          "id": 123456,
          "agreement": "GDPR-Hjälpen",
          "slug": "gdpr-hjalpen",
          "timestamp": "2019-02-05 10:11:28",
          "esign_enabled": false,
          "file": "https:\/\/demo.sb.com\/api\/v1\/document\/F557R270"
          "update": "https:\/\/demo.sb.com\/apps\/testform\/1\/1\/laterfill\/35"
        },
        {
          "agreement": "Juridisk behovsanalys",
          "timestamp": "2019-02-05 09:02:47",
          "esign_enabled": false,
          "file": "https:\/\/demo.sb.com\/api\/v1\/document\/111114801"
        }
      ],
      "started": [
        {
          "id": 65432,
          "agreement": "GDPR-Hjälpen",
          "slug": "gdpr-hjalpen",
          "timestamp": "2019-02-05 11:11:28",
          "continue": "https:\/\/demo.sb.com\/apps\/gdprhelp\/1\/1\/laterfill\/57"
          "cancel": "https:\/\/demo.sb.com\/api\/v1\/agreement\/726989\/cancel"
        }
      ],
      "signed": [
        {
          "id": 654,
          "agreement_id": 354871,
          "filename": "GDPR-Hjälpen",
          "timestamp": "2019-02-08 10:11:28",
          "file": "https:\/\/demo.sb.com\/api\/v1\/document\/SF3765"
        }
      ],
      "uploaded": [
        {
          "agreement": "Homemade agreement",
          "timestamp": "2019-02-12 09:02:47",
          "file": "https:\/\/demo.sb.com\/api\/v1\/document\/L897567"
        }
      ],
    }

    GET /api/v1/user

    Get the user information including agreements the user has bought (bought), started (started) with, signed (signed) and agreements made by a lawyer (uploaded). The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    TimeZone
    optional

    Used for setting the time zone for incoming and outgoing date and time stamps. As default it's set to GMT (except for avtal24.se that's set to Europe/Stockholm).

    TimeZone: Europe/Paris

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    Information about the current user and bought agreements. The data is returned in JSON format.

    404

    No customer found (customer_not_found).

    Response data

    SThe data will be returned organized in four different categories - "customer" (general customer information), "bought" (bought agreements), "started" (started agreements), "signed" (e-signed documents), "uploaded" (documents uploaded by a laywer or by the user).

    Variable Description Type In
    customer > access_token The access_token for the current user. This will just be included in the JWT is given String
    customer > id The ID of the customer in the system String
    customer > account_id The ID for the current account String
    customer > name The name of the customer String
    customer > company The company name, if the user in connected to a company String
    customer > email The email to the customer String
    customer > phone The phone to the customer String
    customer > ssn The social security number for the customer String YYYYMMDDNNNN
    customer > address The address to the customer String
    customer > address2 The address to the customer String
    customer > zip The customers zip code String
    customer > city The customers city String
    customer > deal_id The deal ID for the customer String
    customer > type Account type - Private, Company or Business String
    customer > subscription_type_id If a business account - the subscription type String
    customer > subscription_type_name If a business account - the subscription name String
    bought > id The ID of a bought agreement Integer
    bought > agreement Name of the agreement String a-z
    bought > slug The url identifier for the product String
    bought > timestamp The timestamp when the agreement was finalized String
    bought > esign The URL to the page for e-signing String
    bought > information The API URL for general info related to the agreement String
    bought > file The API URL to the agreement. This can be user for opening or deleting the agreement. String
    bought > update The URL for updating the current agreement String
    started > id The ID of a started agreement Integer
    started > agreement Name of the agreement String
    started > slug The url identifier for the product String
    started > timestamp The timestamp when the creation of the agreement started String
    started > continue The URL to the agreement to continue the flow String
    started > cancel The API URL for deleting the agreement draft String
    signed > id The ID for the e-signing process Integer
    signed > agreement_id The ID of the agreement that should be signed Integer
    signed > filename The filename String
    signed > timestamp The timestamp when the e-signing was finished String
    signed > file The API URL to the e-signed file. String
    uploaded > filename The filename String
    uploaded > timestamp The timestamp when the file was uploaded String
    uploaded > file The API URL to the uploaded file. String

    Get/select account

    Example of returned data for a request without id:

    {
      {
        "id": "81494",
        "email": "lars.olsson@email.com",
        "name": "Lars Olsson",
        "company": "",
        "partner_id": "66",
        "deal_id": "83",
        "type": "Private",
        "login": "bankid"
      },
      {
        "id": "85124",
        "email": "lars.olsson@lo.com",
        "name": "Lars Olsson",
        "company": "LO bolaget",
        "type": "Company",
        "login": "bankid"
      }
      {
        "id": "85124",
        "email": "lars.olsson@email.com",
        "name": "Lars Olsson",
        "company": "AB Avtal24",
        "type": "Business",
        "subscrption_type_id": "4",
        "subscrption_type_name": "Zero",
        "login": "bankid"
      }
    ]

    Example of returned data for a request id for switching current users account:

    {
      "success": true,
      "access_token": "f5997236a67238569320dd4e9aadaca7422f6b55",
      "success": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2ODQ5NjMyNDAsImV4cCI6MTY4NDk2Njg0MCwiaXNzIjoiQ1JNIiwiZW1haWwiOiJsYXJzLm5pY2FuZGVyQGxleGx5LmNvbSIsInVzZXJfaWQiOiJlMmFiYzRiMC03Zjg4LTRmODMtOGI0Yy00NTVjM2NmNWRiZGYiLCJuYW1lIjoiTGFycyBOaWNhbmRlciIsImZpcnN0X25hbWUiOiJMYXJzIiwibGFzdF9uYW1lIjoiTmljYW5kZXIiLCJ0ZW5hbnRfaWQiOiI3YmE7..."
    }

    GET /api/v1/account

    GET /api/v1/account/{id}

    Get or select (with id) an account for the current user. If the account is connected to a partner/deal the partner_id and deal_id will be included. If it's a business account the current subscription type will return subscription type id and the name of the subscription type. The data is returned in JSON format.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    Requests without id - Information current users different accounts. The data is returned in JSON format.

    200

    Requests with id - returning status 'true'. The data is returned in JSON format.

    401

    Returning 401 if the current user don't have access to the requested id. The data is returned in JSON format.

    Logout

    GET /api/v1/logout

    Log the user out by deleting the access token (ccokies and sessions).

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    Doesn't take any parameters.

    Responses

    Code Description
    200

    Requests without any input. All data related to the user is deleted. The data is returned in JSON format.

    401

    Returning 401 if the current user don't have access to the requested id. The data is returned in JSON format.

    Post

    Authenticate BankID upgrade

    Example of posted data:

    {
      "ssn": "199204178888",
      "reset_slug": "57ORqt9lNo6z1Ex3DDbVMRfxs4873e",
      "org_number": "5562408475",
      "bank_id": "true",
      "autologin": "true",
    }

    Example of returned data if all went well and bankid is set to true:

    {
      "orderRef": "d06821ef-eb4c-4064-9413-25630cc06ccb",
      "autoStartToken": "3c61f6ca-74ba-4bc6-8935-d03e38fbf1d7"
    }

    POST /api/v1/authenticateBankIdUpgrade

    Authenticate BankID upgrade. If provided information is correct it will convert password account to BankID account.

    If the authentication went well you will get an oauth access token that can be used to access all APIs.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    ssn
    required

    SSN which will be connected to user account (YYYYMMDDNNNN).

    string
    application/json

    Json

    reset_slug
    required

    Reset slug is which is sent out to users.

    string
    application/json

    Json

    org_number

    If organization number is sent the account will be converted into a Lexly Business account with the given user as owner (XXXXXX-NNNN).

    string
    application/json

    Json

    bank_id
    required

    Required for authentication

    boolean
    application/json

    Json

    autologin
    required

    User will auto logged in after the authentication.

    boolean
    only numbers

    Json

    Responses

    Code Description
    200

    Returning the oauth access token if everything went well

    400

    authentication failed (request_parameters_missing).

    400

    Missing parameters

    Book meeting

    Example of posted data (with Partner Access Credentials authorisation):

    {
      "partner": "test",
      "deal_id": "100",
      "customer": {
        "name": "Lars Nilsson",
        "email": "lars@nilsson.eu",
        "phone": "0732220825",
        "ssn": "196503080291",
        "text": "Free text - not oblig" },
      "calendar": {
        "date": "2019-03-20",
        "time": "1400",
        "lawyer": "97940" },
      "advisor": {
        "name": "Nils Bankir",
        "email": "a12342@banken.se",
        "phone": "0771121212",
        "group": "Stockholm",
        "subgroup": "Norrmalmstorg" }
    }

    Example of returned data if all went well:

    {
      "access_token": "f8e37a675e212549bcf64c0ac511168f9740580d",
      "expires_in": 3600,
      "token_type": "Bearer",
      "scope": null
      "jwt": "f8e37a675e212549bc....f64c0ac511168f9740580d"
    }

    Example of posted data (with OAuth authorisation):

    {
      "customer":{
        "name": "Lars Nilsson",
        "email": "lars@nilsson.eu",
        "phone": "0732220825",
        "ssn": "196503080291",
        "text": "Free text - not oblig" },
      "calendar": {
        "date": "2019-03-20",
        "title": "Test booking",
        "description": "This is a test!",
        "time": "1400",
        "length": 30,
        "lawyer": 97940 }
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    Example of posted data (with OAuth or CID authorisation):

    {
      "calendar": {
        "date": "2019-03-20",
        "title": "Test booking",
        "description": "This is a test!",
        "time": "1400",
        "length": 30,
        "lawyer": 97940 }
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    Example of posted data for reschedule a meeting (with OAuth or CID authorisation):

    {
      "calendar": {
        "date": "2019-03-20",
        "title": "Test booking",
        "description": "This is a test!",
        "time": "1400",
        "length": 30,
        "lawyer": 97940 }
        "event_id": "57565" }
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    POST /api/v1/meeting

    Booking a meeting. This can be done either via Partner Access Credentials, CID or OAuth authorisation. Required fields depends on the way of authorisation.

    If the request is made via Partner Access Credentials you will get the token for the new user directly.

    Header

    Header Description Example

    Authentication
    required

    Supports all kind of authentication

    See Authentication

    TimeZone
    optional

    Used for setting the the time zone for incoming and outgoing date and time stamps. As default it's set to GMT (except for avtal24.se that's set to Europe/Stockholm).

    TimeZone: Europe/Paris

    Parameters

    Parameter Description Type In

    partner_id

    The partner_id that is set for an anonymous user that do not have a deal_id set (ie does not have OAuth permission). This will be ignored on OAuth authorisation.

    integer
    int64

    Json

    deal_id
    (occasionally required)

    The segment the meeting should be booked in. This is required on Partner Access Credentials authorisation but shouldn't be included on OAuth authorisation.

    integer
    int64

    Json

    customer->name
    required

    The name of the customer.

    string
    application/json

    Json

    customer->email
    required

    The customer's e-mail.

    string
    application/json

    Json

    customer->phone
    required

    The customer's phone number.

    string
    only numbers

    Json

    customer->ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Json

    customer->text

    Additional information the customer would like to inform about before the meeting.

    string
    application/json

    Json

    calendar->date
    required

    The date of the meeting.

    date
    YYYY-MM-DD

    Json

    calendar->title
    (occasionally required)

    The title for the calendar entry. This is required on CID or Oauth authorisation but shouldn't be included on Partner Access Credentials authorisation.

    string
    application/json

    Json

    calendar->description
    (occasionally optional)

    The description for the calendar entry. This is optional on CID or Oauth authorisation but shouldn't be included on Partner Access Credentials authorisation.

    integer
    int64

    Json

    calendar->time
    required

    The starting time of the meeting.

    string
    HHMM

    Json

    calendar->length
    (occasionally required)

    The length in minutes for the calendar event.

    integer
    int64

    Json

    calendar->lawyer
    required

    The id of the lawyer who will join the meeting. Got from the GET meeting request above.

    integer
    int64

    Json

    calendar->event_id
    (occasionally required)

    The event id must be included if it's a reschedule request.

    integer
    int64

    Json

    calendar->length
    (occasionally required)

    The length for the meeting that's being booked. If not given the default will be 30 min.

    integer
    int64

    Json

    calendar->product_id

    The product id for the current agreement the booking is related to. Example: 10732. This is just used for the title in the generated calender event.

    integer
    int64

    Json

    calendar->slug

    The slug for the agreement the bookning is related to. Example: 'Samboavtal'. This is just used for the title in the generated calender event.

    integer
    int64

    Json

    calendar->type

    Meeting type. Possible values: "phonemeeting" and "videomeeting".
    The default value if nothing is given is "phonemeeting".

    string
    phonemeeting / videomeeting

    Json

    advisor->name
    (occasionally required)

    The name of the advisor. It's used for reports and can be set to a static value for example 'Robot'.
    This is required on Partner Access Credentials authorisation but shouldn't be included on OAuth authorisation.

    string
    application/json

    Json

    advisor->email
    (occasionally required)

    The email of the advisor. It's used for reports and can be set to a static value for example 'robot@partner.com'.
    This is required on Partner Access Credentials authorisation but shouldn't be included on OAuth authorisation.

    string
    application/json

    Json

    advisor->phone

    The phone number to the advisor. The phone number may only have numeric characters.
    This will only be used for Partner Access Credentials authorisation.

    string
    only numbers

    Json

    advisor->group

    The advisor's working group. This is used for reports and can have any type of value for example: 'Stockholm' or 'Call center'
    This will only be used for Partner Access Credentials authorisation.

    string
    application/json

    Json

    advisor->subgroup

    The advisor's working subgroup. This used for reports and can have any type of value for example: 'Södermalm' or 'Team 10'
    This will only be used for Partner Access Credentials authorisation.

    string
    application/json

    Json

    Responses

    Code Description
    200

    The current free meeting slots available to book for the customer. The data is returned in JSON format.

    400

    Required fields missing or incorrect.

    Post agreement data

    Example of posted data:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "phone": "+46705451245",
      "email": "lars.nilsson@company.com",
      "ssn": "197403070282",
      "deal_id": 245,
      "agreement_id": 123,
      "data": {
        "field1": 1278
        "field2": "Kalle kula"
      }
    }

    Example of returned data if all went well:

    {
      "success": true,
      "agreement": "http:\/\/api.lexly.com\/api\/v1\/document\/F123R54\/pqvXyk6t5bXiDAHq"
    }

    POST /api/v1/agreement

    Post agreement data to create a new agreement and, if needed, register a new user (if you accessing this API without any authorization bearer (See Oauth).

    If everything went well you will receive a link to the new generated agreement. This link will be accessible in 5 minutes.

    Header

    Header Description Example

    Authentication

    Supports all kind of authentication and is also accessible without and authentication if at least "phone" or "email" is included.

    See Authentication

    Parameters

    Parameter Description Type In

    first_name

    The first name of the customer.

    string
    application/json

    Json

    last_name

    The last name of the customer.

    string
    application/json

    Json

    email
    (occasionally required)

    The e-mail to the customer. Email and/or phone is required to create a new agreement for a new user that do not have any existing user.

    string
    application/json

    Json

    phone
    (occasionally required)

    The phone number to the customer. Email and/or phone is required to create a new agreement for a new user that do not have any existing user.

    string
    only numbers

    Json

    ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Json

    deal_id

    Required for new customer to get a partner deal.

    integer
    int64

    Json

    agreement_id
    (required)

    The ID for the current agreement.

    integer
    int64

    Json

    data > {field_name}
    (required)

    Values for all current fields for the agreement. One to many.

    integer/ string/ etc.

    Json

    Responses

    Code Description
    200

    Returning status true and a link to the created agreement that will be accessible in 5 minutes without tooken.

    400

    Failed registering new user.

    400

    The swedish personal number wasn't correct.

    404

    The agreement id isn't corrrect.

    409

    The swedish personal number is already registered to an other user.

    Register a new company

    Example of posted data:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "phone": "+46705451245",
      "email": "lars.nilsson@company.com",
      "ssn": "197403070282",
      "bankid": true,
      "autologin": true,
      "company": {
        "org_number": "5562408475",
        "org_name": "Siteam Aktiebolag",
        "address": "Tideliusgatan 23",
        "org_post_city": "Stockholm",
        "org_post_number": "11869",
        "deal_id": "0",
        "sub_type": "2"
      }
    }

    Example of returned data if all went well and bankid is set to false:

    {
      "access_token": "f8e37a675e212549bcf64c0ac511168f9740580d",
      "expires_in": 3600,
      "token_type": "Bearer",
      "scope": "Private",
      "jwt": "f8e37a675e212549bc....f64c0ac511168f9740580d"
      "refresh_token": "417415d2d90747d93a9cec1a0ce76cb312c4377d",
    }

    Example of returned data if all went well and bankid is set to true:

    {
      "orderRef": "d06821ef-eb4c-4064-9413-25630cc06ccb",
      "autoStartToken": "3c61f6ca-74ba-4bc6-8935-d03e38fbf1d7"
    }

    POST /api/v1/company

    Register new user. The user will get an welcome mail and login information sent the the registered email address. This can be done either via Partner Access Credentials.

    If the registration went well you will get an oauth access token that can be used to access all APIs.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    first_name

    The first name of the customer.

    string
    application/json

    Json

    last_name

    The last name of the customer.

    string
    application/json

    Json

    email
    required

    The e-mail to the customer.

    string
    application/json

    Json

    phone

    The phone number to the customer.

    string
    only numbers

    Json

    password

    Any random password with characters as A-Za-z0-9!#&%@$£. If a password is given the created account will be a password account.

    string
    application/json

    Json

    ssn

    The swedish personal number, requered for bankid login.

    interger
    YYYYMMDDNNNN

    Json

    autologin

    If autologin is set to true the new registered user will login directly and receive the current token (or, in Sweden, start a BankId login process if bankid is set to true).

    boolean
    true/false

    Json

    bankid

    If set to true the new registered user will get a bankid account (specific for Sweden).

    boolean
    true/false

    Json

    company > org_number
    required

    The organisation number for the company.

    string
    application/json

    Json

    company > org_name
    required

    The name of the company.

    string
    application/json

    Json

    company > address

    The zip code for the company.

    string
    application/json

    Json

    company > org_post_city

    The city for the company.

    string
    application/json

    Json

    company > org_post_number

    The zip code for the company.

    string
    application/json

    Json

    company > deal_id
    (occasionally required)

    Required for the customer to get a partner deal.

    string
    application/json

    Json

    company > sub_type
    required

    Define type of subscription - 1 = bas, 2 = pro, 3 = premium

    string
    application/json

    Json

    Responses

    Code Description
    200

    Returning the oauth access token if everything went well

    400

    Failed to register the company (request_parameters_missing).

    400

    The SSN parameter could not be parsed becaurse it's incorrect or already in use for that company (incorrect_or_already_used_ssn).

    Register a new user

    Example of posted data:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "phone": "+46705451245",
      "email": "lars.nilsson@company.com",
      "ssn": "197403070282",
      "address": "Testvägen 3",
      "address2": "",
      "zip": "11122",
      "city": "Stockholm",
      "password": "67Hkassa7K!",
      "deal_id": 245
      "autologin": true
    }

    Example of returned data if all went well:

    {
      "access_token": "f8e37a675e212549bcf64c0ac511168f9740580d",
      "expires_in": 3600,
      "token_type": "Bearer",
      "scope": "Private",
      "jwt": "f8e37a675e212549bc....f64c0ac511168f9740580d"
      "refresh_token": "417415d2d90747d93a9cec1a0ce76cb312c4377d",
    }

    Example of posted data for BankId login:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "phone": "+46705451245",
      "email": "lars.nilsson@company.com",
      "ssn": "197403070282",
      "bankid": true
      "autologin": true
    }

    Example of returned data if all went well:

    {
      "orderRef": "d06821ef-eb4c-4064-9413-25630cc06ccb",
      "autoStartToken": "3c61f6ca-74ba-4bc6-8935-d03e38fbf1d7"
    }

    Example of posted data for BankId login with "url" given:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "email": "lars.nilsson@company.com",
      "ssn": "197403070282",
      "bankid": true,
      "url": "https://lexly.se/verification"
    }

    Example of returned data if the email already exist and there isn't a bankid account:

    {
        "reset_slug": "5u9CT2h4h6AKnwAMTYFWJluO49c25Y"
    }

    POST /api/v1/user

    Register new user. The user will get an welcome mail and login information sent the the registered email address. This can be done either via Partner Access Credentials.

    If the registration went well you will get an oauth access token that can be used to access all APIs.

    If "url" is included in the request and the email already exist in the system the user will get an email with a link where the reset slug is included (exactly as from Send verification mail for BankID upgrade).

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    first_name

    The first name of the customer.

    string
    application/json

    Json

    last_name

    The last name of the customer.

    string
    application/json

    Json

    email
    required

    The e-mail to the customer.

    string
    application/json

    Json

    phone

    The phone number to the customer.

    string
    only numbers

    Json

    ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Json

    address

    The main address line for the customer.

    string
    application/json

    Json

    address2

    If needed the second address row for the customer.

    string
    application/json

    Json

    zip

    The zip code for the customer.

    string
    application/json

    Json

    city

    The city for the customer.

    string
    application/json

    Json

    password

    Any random password with characters as A-Za-z0-9!#&%@$£. If a password is given the created account will be a password account.

    string
    application/json

    Json

    bankid

    If set to true the new registered user will get a bankid account (specific for Sweden).

    boolean
    true/false

    Json

    deal_id
    (occasionally required)

    Required for the customer to get a partner deal.

    integer
    int64

    Json

    autologin

    If autologin is set to true the new registered user will login directly and receive the current token (or (in Sweden) start a BankId login process if no password is given).

    boolean
    true/false

    Json

    url

    For modifying the verification link. By including this an email with a reset instructions for updating the account to a bankId account will be sent out if the email already exists in the system and isn't already a bankId account.

    string
    application/json

    Json

    Responses

    Code Description
    200

    Returning the oauth access token if everything went well

    200

    If "url" is set and the email already exist and everything went well. The variables that's returned in json format are "reset_slug" which need to be forwarded and sometimes "customer_type" which can have the values "private" or "business"

    400

    Failed to update the user (request_parameters_missing).

    400

    The SSN parameter could not be parsed becaurse it's incorrect or already in use (incorrect_or_already_used_ssn).

    409

    The user already exists (user_already_exist).

    Request for resetting password

    Example of posted data:

    {
      "email": "aaa@sogetthis.com",
    }

    Example of returned data if all went well:

    {
      "email": "aaa@sogetthis.com",
      "resetcode": "RU6IDIS1tNb6",
    }

    POST /api/v1/reset

    An api for starting a process for resetting the password for a user.

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    email
    required

    The email for the user who is updating password.

    string
    application/json

    Json

    Responses

    Code Description
    200

    Returning resetcode and the requested email. If the reset failed it will return false as the resetcode.

    Send contact form info

    Example of posted data:

    {
      "partner_id": 15,
      "legal_area": "Familjejuridik",
      "customer": {
        "text": "Test enrollment",
        "name": "Lars Larsson",
        "email": "lars.larsson@example.com",
        "phone": "0704208987"
      },
      "calendar": {
        "date": "2021-12-01",
        "time": "1330",
        "length": 30,
        "lawyer": 85494,
        "product_id": 9761,
        "type": "phonemeeting"
      },
      "google_analytics_client_id": "1234.5678"
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    POST /api/v1/contactform

    An API to handle dynamic form data.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials, Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    partner_id

    The partner_id that is set for an anonymous user that do not have a deal_id set (ie does not have OAuth permission). This will be ignored on OAuth authorisation.

    integer
    int64

    Json

    deal_id

    The current deal a logged in user is taged to.

    integer
    int64

    Json

    origin

    The page/product from where th lead originated.

    string
    Json

    Json

    legal_area
    required

    A text describing the related legal area.

    string
    Json

    Json

    contact_when
    (occasionally required)

    Required when the customer what to be contacted via phone.

    string
    Json

    Json

    customer->name
    required

    The name of the customer.

    string
    application/json

    Json

    customer->email
    required

    The customer's e-mail.

    string
    application/json

    Json

    customer->phone
    required

    The customer's phone number.

    string
    only numbers

    Json

    customer->text

    Additional information the customer would like to inform about.

    string
    application/json

    Json

    customer->city
    (occasionally required)

    The city in which the customer would like to meet a lawyer in person. If this field is included the customer will be contacted to book a physical meeting.

    string
    application/json

    Json

    calendar->date
    (occasionally required)

    The date of the meeting. Required when booking a meeting (not physical).

    date
    YYYY-MM-DD

    Json

    calendar->time
    (occasionally required)

    The starting time of the meeting. Required when booking a meeting (not physical).

    string
    HHMM

    Json

    calendar->length

    The length in minutes for the calendar event. Can just be set when booking a meeting (not physical).

    integer
    int64

    Json

    calendar->lawyer
    (occasionally required)

    The id of the lawyer who will join the meeting. Got from the GET meeting request above. Required when booking a meeting (not physical).

    integer
    int64

    Json

    calendar->product_id

    The product id for the current agreement the booking is related to. Example: 10732. This is just used for the title in the generated calender event.

    integer
    int64

    Json

    calendar->type

    Meeting type. Possible values: "phonemeeting" and "videomeeting".
    The default value if nothing is given is "phonemeeting".

    string
    phonemeeting / videomeeting

    Json

    google_analytics_client_id

    Analytics ID to track booking

    string

    Json

    Responses

    Code Description
    200

    The current free meeting slots available to book for the customer. The data is returned in JSON format.

    404

    Required fields missing or incorrect or the given time/date for the calendar booking isn't free any longer.

    Send contact info

    Example of posted data:

    {
      "inbox": "lexly-lawyer-swedish",
      "origin": "awesome-product",
      "type": "phone",
      "name": "Lars Larsson",
      "email": "lars.larsson@example.com",
      "phone": "123123",
      "message": "An important message to my lawyer."
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    POST /api/v1/contact

    Send customer info to the leads inbox.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    inbox
    required

    Which inbox the lead should be sent to. Potential values:
    (lexly|lco)-(lawyer|paralegal)-(language)

    string

    Json

    origin
    required

    The page/product from where th lead originated.

    string

    Json

    type
    required

    What type of lead is it. Possible values are: phone, email, physical.

    string

    Json

    name
    required

    The name of the customer.

    string

    Json

    email
    required

    The customer's email.

    string
    email

    Json

    phone
    required

    The customer's phone.

    string

    Json

    message

    A message from the customer to the lawyer. Can be empty string.

    string
    can be empty

    Json

    partner_id

    The partner_id that is set for an anonymous user that do not have a deal_id set (ie does not have OAuth permission). This will be ignored on OAuth authorisation.

    integer
    int64

    Json

    deal_id

    The current deal a logged in user is taged to.

    integer
    int64

    Json

    Responses

    Code Description
    200

    The current free meeting slots available to book for the customer. The data is returned in JSON format.

    400

    Required fields missing or incorrect.

    Possible error types:
    request_parameters_missing
    invalid_origin
    invalid_type
    invalid_name
    invalid_email
    invalid_phone

    404

    Specified inbox does not exist.

    Send partner form info

    Example of posted data (with Partner Access Credentials authorisation):

    {
      "deal_id": 100,
      "legal_area": family-law,
      "customer": {
        "name": "Lars Nilsson",
        "email": "lars@nilsson.eu",
        "phone": "0732220825",
        "ssn": "196503080291" }
      "calendar": {
        "type": "phone",
        "date": "2022-07-15",
        "time": "1400",
        "lawyer": "85494" }
      "advisor": {
        "name": "Nils Bankir",
        "email": "a12342@banken.se",
        "phone": "0771121212",
        "group": "Stockholm",
        "subgroup": "Norrmalmstorg" }
    }

    Example of returned data if all went well:

    {
      "status": "true"
    }

    POST /api/v1/partnerform

    An API for sending a partner leads. This can only be done with a Partner Access Credentials. The different setup of returned values depends of selected form type - see Get partner form structure.

    Header

    Header Description Example

    Authentication
    required

    Only supports Partner Access Credentials

    See Authentication

    Accept-Language

    Specify the language in which the content should be sent. Possible languages are indicated as the following - only one should be specified: sv, en, etc

    Parameters

    Parameter Description Type In

    deal_id
    required

    The segment the customer belongs to (listed in Get partner form structure).

    integer
    int64

    Json

    legal_area
    required

    The legal area the case the customer would like to handle belongs to (potential are listed in Get partner form structure).

    sting
    application/json

    Json

    situation

    The customers situation (potential are listed in Get partner form structure).

    sting
    application/json

    Json

    co_owners

    The number of co-owners of a company. Just relevant for companies.

    sting
    application/json

    Json

    contact_type
    required

    The potential options are listed as "contact_type" under "legal_areas -> form_types" from Get partner form structure.

    sting
    application/json

    Json

    customer->name
    required

    The name of the customer.

    string
    application/json

    Json

    customer->email

    The customer's e-mail.

    string
    application/json

    Json

    customer->phone

    The customer's phone number.

    string
    only allow numbers and '-','+',' '

    Json

    customer->ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Json

    customer->city
    (sometime required)

    Required for physical meetings. Shouldn't be included for other form of meetings.

    string
    application/json

    Json

    customer->text

    Information when the customer would like to be contacted.

    string
    application/json

    Json

    calendar->type
    required

    Meeting type. Possible values: "phone" and "video".
    The default value if nothing is given is "phone".

    string
    phone / video

    Json

    calendar->date
    required

    The date of the meeting.

    date
    YYYY-MM-DD

    Json

    calendar->time
    required

    The starting time of the meeting.

    string
    HHMM

    Json

    calendar->lawyer
    required

    The id of the lawyer who will join the meeting. Got from the GET meeting request above.

    integer
    int64

    Json

    advisor->name

    The name of the advisor. It's used for reports and can be set to a static value for example 'Robot'.

    string
    application/json

    Json

    advisor->email

    The email of the advisor. It's used for reports and can be set to a static value for example 'robot@partner.com'.

    string
    application/json

    Json

    advisor->phone

    The phone number to the advisor. The phone number may only have numeric characters.

    string
    only allow numbers and '-','+',' '

    Json

    advisor->group

    The advisor's working group. This is used for reports and can have any type of value for example: 'Stockholm' or 'Call center'.

    string
    application/json

    Json

    advisor->subgroup

    The advisor's working subgroup. This used for reports and can have any type of value for example: 'Södermalm' or 'Team 10'.

    string
    application/json

    Json

    Responses

    Code Description
    200

    The contact info is sent and an internal contact ticket has been created. The data is returned in JSON format.

    400

    Required fields missing or incorrect.

    Send verification mail for BankID upgrade

    Example of posted data:

    {
      "email": "test@test.se",
      "url": "https://test.se"
    }

    Example of returned data if all went well:

    {
      "reset_slug": "5u9CT2h4h6AKnwAMTYFWJluO49c25Y",
      "customer_type": "business"
    }

    Example of if account is already upgraded to BankID

    {
      "error_type": "already_bankid_account",
      "error_message": "Account is already upgraded to BankID.",
       "http_code": "400"
    }

    POST /api/v1/upgradeToBankIdVerificationMail

    This sends out verification email to user, the user will get a link with reset_slug. The url parameter is used for modifying the verification link.

    If the account is not already upgraded to BankID it will return a reset slug.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner Access Credentials

    See Authentication

    Parameters

    Parameter Description Type In

    email
    required

    The mail address that has password account.

    string
    application/json

    Json

    url

    For modifying the verification link.

    string
    application/json

    Json

    Responses

    Code Description
    200

    Returning if everything went well. The variables that's returned in json format are "reset_slug" which need to be forwarded and sometimes "customer_type" which can have the values "private" or "business"

    400

    Failed to send out email.

    400

    Email is missing.

    Subscribe to newsletter

    POST /api/v1/subscribe

    Subscribe a customer to newsletter subscription.

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    email
    required

    The e-mail to the customer.

    string
    application/json

    Json

    customer_type

    Type of customer - business or private. The default is private.

    string
    application/json

    Json

    confirmation

    If a confirmation should be sent to the customer or not (true/false). The default is true.

    boolean

    Json

    Responses

    Code Description
    200

    Returning true or false if the email already exist.

    400

    The email is missing or incorrect

    Upload a document to for a customer

    POST /api/v1/document

    Upload documents (supports one or more files) connected to a customer. This can be done either via CID or OAuth authorisation.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials, OAuth and CID

    See Authentication

    Parameters

    Parameter Description Type In

    customer_file
    required

    The file(s) that should be uploaded.

    file(s)
    pdf, doc, docx, png, jpg, xlsx, ppt, pptx

    Multipart Form Data

    Responses

    Code Description
    200

    Returning File uploaded successfully or an error message, for example File already exist

    400

    Failed to upload file (failed_to_upload_file).

    Put

    Update password

    Example of posted data:

    {
      "email": "aaa@sogetthis.com",
      "password": "aaa798HUH87yuaaaaa",
      "resetcode": "RU6IDIS1tNb6",
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    PUT /api/v1/reset

    An api for setting password for a user.

    Header

    Header Description Example

    Authentication
    (sometime required)

    Supports Partner OAuth Credentials and OAuth. To update the password without a resetcode you need a Bearer token as authentication else you don't need any.

    See Authentication

    Nothing required.

    Parameters

    Parameter Description Type In

    email
    required

    The email for the user who is updating password.

    string
    application/json

    Json

    password
    required

    The new password for the user.

    string
    application/json

    Json

    resetcode
    (sometime required)

    The resetcode earlier received via POST /api/v1/reset. Not needed if you have an authentication token.

    string
    application/json

    Json

    Responses

    Code Description
    200

    Returning status true if everything went well.

    400

    Failed to update the password (the reset code is just valid in 5 min).

    Update user information

    Example of posted data:

    {
      "first_name": "Lars",
      "last_name": "Nilsson",
      "email": "lars.nilsson@company.com",
      "phone": "+46705451245",
      "address": "Testvägen 3",
      "address2": "",
      "zip": "11122",
      "city": "Stockholm",
      "deal_id": 245
    }

    Example of returned data if all went well:

    {
      "status": true
    }

    PUT /api/v1/user

    Updating user information.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth (you need a Bearer token).

    See Authentication

    Parameters

    Parameter Description Type In

    first_name

    The first name of the customer.

    string
    application/json

    Json

    last_name

    The last name of the customer.

    string
    application/json

    Json

    email

    The e-mail to the customer.

    string
    application/json

    Json

    phone

    The phone number to the customer.

    string
    only numbers

    Json

    ssn

    The swedish personal number.

    interger
    YYYYMMDDNNNN

    Json

    address

    The main address line for the customer.

    string
    application/json

    Json

    address2

    If needed the second address row for the customer.

    string
    application/json

    Json

    zip

    The zip code for the customer.

    string
    application/json

    Json

    city

    The city for the customer.

    string
    application/json

    Json

    deal_id

    Required for the customer to get a partner deal.

    integer
    int64

    Json

    Responses

    Code Description
    200

    Returning the oauth access token if everything went well

    400

    Failed to update the user (request_parameters_missing).

    400

    The SSN parameter could not be parsed becaurse it's incorrect or already in use (incorrect_or_already_used_ssn).

    Delete

    Delete agreement

    DELETE /api/v1/agreement/{agreement_id}

    Delete the started agreement with given id for the Oauth identified user. This is just used for deleting agreements the haven't been finished.

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    agreement_id
    required

    The agreement_id you get when requesting user information.

    string
    application/json

    path

    Responses

    Code Description
    200

    The requested file has been deleted.

    400

    Required fields missing or incorrect.

    401

    The user is unauthorised.

    404

    The resource was not found.

    Delete document

    DELETE /api/v1/document/{file_id}

    Delete the file that is associated with the customer information for the Oauth identified user. The file IDs can be as hi-lighted below:

    • For Agreements made via Agreement Builder
      http://api.lexly.se/api/v1/document/F485R11418
    • For signed document
      http://api.lexly.se/api/v1/document/SF3759
    • For document uploaded by lawyers
      http://api.lexly.se/api/v1/document/L97100
    • For document made via Wizard Builder
      http://api.lexly.se/api/v1/document/W3fa85f64-5717-4562-b3fc-2c963f66afa6/agreement

    Header

    Header Description Example

    Authentication
    required

    Supports Partner OAuth Credentials and OAuth

    See Authentication

    Parameters

    Parameter Description Type In

    file_id
    required

    The file_id you get when requesting user information.

    string
    application/json

    path

    Responses

    Code Description
    200

    The requested file hads been deleted.

    400

    Required fields missing or incorrect.

    403

    The access credentials provided do not have sufficient privileges for this request.

    Unsubscribe form newsletters

    DELETE /api/v1/subscribe

    Unsubscribe a customer from newsletter subscription.

    Header

    Header Description Example

    Nothing required.

    Parameters

    Parameter Description Type In

    email
    required

    The e-mail to the customer.

    string
    application/json

    Json

    confirmation

    If a confirmation should be sent to the customer or not (true/false). The default is true.

    boolean

    Json

    Responses

    Code Description
    200

    Returning true or false if the email already exist.

    400

    The email is missing or incorrect

    Implementation example

    To get the demo package to work you need a web server (for example Apache HTTP Server) with a Curl client and PHP (version 5.6 or greater).

    You maybe have to update the "SERVER" constant that's defined in agreements/config.php. When that is done, everything should work. As default it's set to the Lexly production server.

    In the package there is one API implementation to generate a list of products with the public API pricelist. The rest is JS implementations of agreement flows.

    The structure in the package is the following:

    Filename Description
    [agreements]
          avtal.php A simple page showing a pricelist, agreement info and a form for booking a meeting
          config.php Configuration of the URLs to the involved servers
          footer.php Code for the standard footer (just </body></html>)
          form.php The main agreement/cart/e-sign page - just a formatted script tag
          header.php Code for the standard header with som scripts and styles
    .htaccess Some important rewrite rules
    index.php Main page with generated links to all agreements
    readme.txt

    Download an example package

    Visit a demosetup