API: Create Session ID

Introduction
Call
Response


Introduction

Session ID is needed for all two-step processes. Asking MachineSense server for Session-ID and providing it to your client-side application is necessary for those processes.

Session ID is a unique identifier of a session. It is used to identify a session in all subsequent calls to MachineSense API. It is necessary to identify and connect the data sent at a later stage with the initial request for a process. Also, response to certain webhook, specified by you, will be possible on the basis of this.

Call

POST auth/v1/create_session_id

Parameters / body:

            {
               "api_key": "string",
               "ref": "string",
               "method": "enroll",
               "client_origin": "own",
               "receive_bitmaps": [array of strings], 
               "images": [array of strings],
               "liveness_method": "string"
            }

Parameters explained:

  • "api_key" = (mandatory) Your developer key found in your Settings
  • "ref" = (optional, default="") Any string you wish to send back to yourself, that you will receive with the later response to your webhook.
  • "method" = (mandatory) MachineSense method required. Can be one of [enum list]
  • "client_origin" = (optional, default="own") Specifies if customer uses own client ("own") or MachineSense hosted client ("ms" | "ms-iframe"). If client_origin="ms", customization/white-labeling is taken in consideration, as specified under partner-settings.
  • "receive_bitmaps" = (optional, default=[]) If you wish to receive also scans/images (in b64 format). Possible values are:
    • Empty array or unspecified = no scans / images
    • "selfie" = selfie image
    • "docface" = document face image
    • "docimage" = document image(s) (front- and back- side for IDs and similar, single image for passports)
    • Example for passport image and selfie: ["selfie", "docimage"]
  • "images" (optional, used only for verify) Array of vectors saved previously during the enrolment process.

Response

Code: 200

Default response:

            {
               "result": "Ok",
               "code": 0,
               "message": "string",
               "data": {
                  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", 
                  "ms_url": "string"
               }
            }

Response explained:

  • "result" = "Ok" or "Err" (error)
  • "code" = 0 or error code (int)
  • "message" = If result "Err" - textual description (string)
  • "data" = JSON object with data
  • "session_id" = string($uuid)
  • "ms_url" = url for MachineSense hosted client-page, if "client_origin"="ms" (string with URL, also containing session_id)

Top of the Page